Single Sign On(SSO) with Embedded okta widget in Angular

Hello team okta,

I’ve created a angular SPA using okta sign in widget (not OIDC login). I want users to be automatically get logged in if there’s an existing valid okta session.
But I found that It is not working as expected. I have to login using sign in widget once again even if there’s valid okta session.

I have followed steps given in Sign in to your SPA with the embedded Okta Sign-In Widget | Okta Developer for embedded okta widget. Also clone project samples-js-angular/custom-login at master · okta/samples-js-angular · GitHub and found that, It also doesn’t provide SSO with Okta sign in widget.

Can you please let me know if it is possible? If its, then can you please provide code sample or hints?

Library used: @okta/okta-signin-widget

Issue: Facing problem with SSO when logging into application (SPA website) without doing login into okta embedded widget.

Expected behaviour : Login into website automatically when user has valid okta session (that is a user is already logged into okta).

Thanks!

You’ll want to detect the existing Okta session, using session.exists() and kick off an /authorize request with getWithoutPrompt() if the session exists, or load the login page/widget if it isn’t

Note that this all hinges on you not encountering the 3rd party cookie blocking mentioned in this FAQ, as these calls will fail if 3rd party cookies are blocked. In short, the solution for this is to configure a custom domain for your Okta org and make sure your app is hosted on the same domain).

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.