okta/okta-auth-js

Okta returns login_required even though user is logged in using redirect model

jeremyjames-sag opened this issue · 2 comments

Describe the bug

I have an Angular 14 project that is using the redirect model to authenticate users. Users are sent an Org hosted login that contains the Sign In Widget and are redirected back to the application once they are logged in.
If the user does not have access to a particular group that was set up on Okta, then the error would be "access_denied" at which point I send them to a custom registration page which they must complete. Once they submit registration, they are added to the group. I can confirm this by viewing the application in our SSO dashboard.

The issue now is that when they are added to the group after registering, login_required is still being returned in the query param. Even though an active session would have already been created.
Because of this the application is stuck in a loop where it redirects to SSO login, see's that the user is already logged in and redirects them back to the app for an authorization code but the error is login_required and the cycle repeats.

The expected outcome is that once it redirects from our SSO application, /authorize should generate the authorization code and then we can get a token.

The strange part of all of this is that this exact flow was implemented in another application recently by me and is currently working as expected. However for some reason I'm getting this loop in the new application. The client ID was changed and all other parameters are the same.

Any insight on what may cause this?

Reproduction Steps?

unable to reproduce as our SSO implementation is behind a vpn

SDK Versions

"@okta/okta-angular": "^6.2.0",
"@okta/okta-auth-js": "^7.3.0",

Additional Information?

No response

@jeremyjames-sag Just to confirm, this is no longer an issue for you?

@jaredperreault-okta correct, turns out they misconfigured the app on Okta