So now it’s not complaining about the files anymore but now I have a new problem that it’s not saving the tokens to local storage. It just leaves them in the URL.
I currently have the Okta Sign-In Widget in a login.component.ts. However unless I manually call the handleauthentication method it will not save the tokens to local storage. This is within an Angular library.
My code is like this:
ngOnInit() {
// can't use required since the google auto-fill on passwords doesn't update the form
if(this.configService.authorizationType == 'okta')
{
this.signIn.renderEl(
{ el: '#sign-in-widget' },
() => {
/**
* In this flow, the success handler will not be called because we redirect
* to the Okta org for the authentication workflow.
*/
},
(err) => {
throw err;
},
);
this.authService.getTokens();
}
My getTokens method looks like this:
public async getTokens() {
await this.oktaService.handleAuthentication();
this.router.navigateByUrl(this.redirectUrl);
}
Hi Shawn. I’m using the OpenID Connect Implicit flow from what I see in the Okta sample code it says that the success handler won’t be executed. In the sample I get from Okta it has this comment for the Sign-In Widget as well. I’m not sure if there is a way that the response is executed. I previously tried to use the success handler and put a simple console.log(res) but it never executed.
/**
* In this flow, the success handler will not be called because we redirect
* to the Okta org for the authentication workflow.
*/