We are migrating our app to an Angular 9 now and we are facing some issues/mismatches from what we had previously with “okta-signin-widget/2.14.0”.
We want to support:
- Hosted Okta widget
- Enabled self registration with Okta
- Enabled social logins - facebook/google
- We want to check for active session if the user is already logged in in the underlying Okta instance
- How to check for active session with Okta from Angular App
- Okta Angular SDK has no notion of .session to be called or interacted with. I think “https://github.com/okta/okta-auth-js#sessionexists” this is what I need, but how to access it from the Angular SDK
- even if I call “https://developer.okta.com/docs/reference/api/sessions/#get-current-session” manually (which I prefer not to), how to proceed if there is an active session? How to initiate the authentication flow from the Angular app using the Okta SDK?
- How to redirect the user AFTER facebook/google login to the Angular App AND still have logged in user with proper access token in the Angular app
- we do have properly configured facebook app and Okta facebook IdP. The hosted widget shows the facebook login button, the flow works, but the user ends up in the Otka Apps screen.
- previously we were using the Settings->Customization -> Default App for Sign-In Widget feature in the Okta Classical console. But now it redirects to the root of the Angular app and that’s it.
- if we solve #1 - I think #2 will work seamlessly
- Where to intercept both self registered and social IdP registered users in the Angular app, so I can properly create those users in my backend API
- we do want single place in the Angular App to handle the login event - for both existing and new users, no matter self registered or coming from facebook/google. Where is the best place to do this and hopefully how…?
I do know that the post got huge, but I think it is better to have the context instead of asking separate questions. Any help will highly appreciated. Tutorials are also welcome.
I have spent 2 weeks digging into forum posts, okta js libraries, okta js Angular libraries, etc.