Angular signInWithRedirect

I’m having trouble getting my sign in redirection to work in an Ionic/Angular app using the okta-angular library.

In the sample app here the signin is handle like this:

await this.oktaAuth.signInWithRedirect({ originalUri: '/' });

what does the originalUri value refer to ? Is there any documentation anywhere that would tell me how to use this signInWithRedirect method and what parameters I can pass to it? Thanks

originalUri tracks where the user was when they were challenged to authenticate. That way if the user attempts to access a secure route in the app that the user must be logged into access, after they are sent to login, they can be sent back to the route they were on.

There’s more information about orginalUri and signInWithRedirect options in the AuthJS readme.

1 Like

Thank you. In my case the user has already logged in to Okta via an external login page - can I call the signInWithRedirect in such a way that I get an access token back without showing a login screen? (Does that make sense?)

I think that will work. There’s also getWithRedirect that also will just trigger the /authorize redirect, so it should observe the user’s existing Okta session (since it will hit the Okta domain to check for the existence of a session to see whether or not the user needs to login).

1 Like