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 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(…)
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.