Dear Okta team,
I am developing an Angular single page application that uses the Okta-SignIn-widget. The login/logout works. However, I have a problem with the registration process. To narrow down the problem, I use your Okta example “custom-login” from GitHub: samples-js-angular. I can register via the widget. I receive an email from Okta with a link and a code. I then click on the link, a request is sent to Okta and Okta calls my application in the browser via a redirect. The URL corresponds to the callback URI that I have set up in Okta under “EMAIL VERIFICATION EXPERIENCE” and looks like this:
http://localhost:8080/custom-login/login/callback?state=ryEnzskZO6TRLha4LeGVOfDRVqduxFW6HFHJqT6gf4uf987pu1a5KXxQXwkl5RDn&otp=266037
The URL therefore contains the query params state and otp. The application starts and calls the OktaCallbackComponent as defined in the routing of the Angular app:
{
path: 'login/callback',
component: OktaCallbackComponent,
},
but then nothing happens. No excepetion on the console, no error.
Here are my questions:
- Am I missing something?
- Is it right to route to the OktaCallbackComponent in this case? Or should I refer to my LoginComponent?
- There are examples in which the otp and state parameters are read within the LoginComponent and used for the SignInWidget. Like this:
const searchParams = new URL(window.location.href).searchParams;
this.signIn.otp = searchParams.get('otp');
this.signIn.state = searchParams.get('state');
I have done the same. Nevertheless, the login does not work.