OKTA signin widget is not rendering on page routing

Hi,
I am using Angular 7.2, @Okta/Okta-angular 1.2.1 and @okta/okta-signin-widget 2.19.0.

On first load of application, I am able to see the login widget but if start routing on other pages which are not required to authentication and coming back on login page again either via app routing or via browser back button then unable to see the login widget.

I found this problem also in okta-sign-in widget sample code. (samples-js-angular/custom-login at master · okta/samples-js-angular · GitHub)

Please provide suggestion to handle this issue.

If you’re seeing this bug in one of our samples, can you please create an issue in the GitHub project for it? Thanks!

Thanks mraible.

I found the solution for this issue.

I am on Angular 6 … and the OktaSignIn.session is undefined. Would you know what could be intefering with the session being properly instantiated? I appreciate any help with this. I got the sample to work as a standalone application. I just copied the angular-okta-signin-widget components over to my project and for some reason the session is undefined … so it cannot do OktaSignIn.session.get(…)

No, I do not know. Can you try running the custom-login sample that uses Angular 8 and see if that works for you?

That did not work for me … so I dropped back to v2.8.0 and it seems to be working. Thank you for your help.

when the sign-in widget returns the token … the url that I use in the sign in widget is: https://dev-xxxxxx.okta.com/ with ‘issuer=default’… (no other base URL will work … adding /oauth2/default throws a CORS exeption) however when my token is returned, the issuer value is: https://dev-xxxxxx.okta.com/oauth2/default. Is this correct? I am trying to verify the token on the server side and I get this error: ‘A signing key must be specified if the specified JWT is digitally signed.’ The only url that works is ‘https://dev-xxxxxx.okta.com/’. I read that this error is thrown because the issuer and the base URL do not match.

To solve your CORS issue, log in to your Okta dashboard and navigate to API > Trusted Origins. Then, add your app’s URL (e.g., http://localhost:8080) to the list of origins.

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