-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ensureAuthenticated and ExpressOIDC configuration conflict when app isn't at the root of the domain #41
Comments
@nickolasfisher The |
@jaredperreault-okta the specific value for my repo is {
"hosting": {
"trailingSlash": true,
"rewrites": [ {
"source": "**",
"function": "app"
}]
}
} as an aside, if I replace the code in
It does work as expected |
This does seems like a bug, thanking you reporting the issue! Internal Ref: OKTA-464266 |
@nickolasfisher A fix for this has been released. Mind confirming with the most recent version? |
no, same behavior on default. I added these two lines before 147 console.log((new URL(context.options.routes.login.path, context.options.appBaseUrl)).href)
console.log(context.options.appBaseUrl); They produce
For clarity, this is without setting routes.login.path |
@nickolasfisher 4.5.1 was released. I tested in the repo you provided and it seemed to work correctly, can you confirm? |
@jaredperreault-okta getting closer. Now the remaining problem is that after the user is authenticated, the app redirects to |
I am having a hard time isolating this issue. My current theory is your You can also see evidence of this in the
I am not familiar with |
For your purposes, you may need to use some custom routes (docs). By defining a or simply use the Feel free to re-open this, but I am closing this ticket for now as I believe the original bug has been fixed |
@jaredperreault-okta I think you're right. In response to your message I did a little googling and came across this thread where it seems this is intended behavior from Firebase. I am running into a few issues with your suggestions though. I may just be a little cross-eyed from looking at this though, so bear with me. I believe the The |
Few things:
|
Really? I have this setting set and its working fine in conjunction with # 3 from your list
Noted
Thank you @jaredperreault-okta |
I'm submitting a:
Current behavior
This issue only appears when you are deployed to a subdirectory of the domain. In my particular instance it's happening because firebase runs the app on http://localhost:5001/{project}/{server}/app rather than http://localhost:5001
When registering the
ExpressOIDC
I first tried to leave the routes.login.path to the default:In this scenario it's possible to manually navigate to the login url but the
ensureAuthenticated
redirect takes me to http://localhost:5001/login.If, on the other hand, I try to manually set
routes.login.path
, thenensureAuthenticated
redirects correctly but the login page 404s.Expected behavior
I would expect the direct from
ensureAuthenticated
to properly use theappBaseUrl
. Failing that, I would expect that setting the full URL would return the login page I set.Minimal reproduction of the problem with instructions
clone repo https://github.com/nickolasfisher/Okta_Firebase_Express
from the app/functions directory run
firebase emulators:start
Once the app starts, click on login. This is going to a protected page at the moment so it should call the
ensureAuthenticated
and navigate tolocalhost:5001/login
.Extra information about the use case/user story you are trying to implement
Environment
node -v
): 17.3.1The text was updated successfully, but these errors were encountered: