I am trying to utilize the Okta Auth JS sdk to sign the users out of my angular application. I want to be able to redirect the user to a page in my app after they are signed out instead of driving them to the Okta Hosted Sign-In Widget. Is there a way to do this?
I have tried just calling oktaAuth.signOut({postRedirectUri: '/sign-out'}) but that does not sign them out of the app.
I have tried using oktaAuth.tokenManager.clear() but that always drives them back to the Okta Hosted Sign-In Widget.
Not sure what I am missing, so any guidance would be appreciated!
The logoutUrl passed would be the logout url found at your authorization server’s well-known endpoint. When you call signOut(), the sdk makes a call to that endpoint where it passes in the id_token_hint and the post_logout_redirect_uri params.
So it doesn’t override it, but it sets that parameter to the url you specify. The value you set for your postLogoutRedirectUri has to match the Sign-out redirect URIs that are set on the client in Okta or it’ll throw a 400 Bad Request: