0

In an Angular application using angular-auth-oidc-client, when a certain route is loaded and the user logs off, I want to send a different 'post_logout_redirect_uri' value to the OIDC server.

I set the postLogoutRedirectUri in the OIDC config:

export const OidcConfig: OpenIdConfiguration = {
    
    postLogoutRedirectUri: window.location.origin + '/index',
    
    // other configuration parameters ...
};

If I set it as a custom param as below:

async signOut() {
    const authOptions: LogoutAuthOptions = {
      customParams: {
        'post_logout_redirect_uri': location.href
      }
    };
    await firstValueFrom(this.oidcSecurityService.logoff(undefined, authOptions));
}

then the logoff() in OidcSecurityService will first add the URI from the config, then the one I set, which will trigger an exception on the server.

How can set a different value for 'post_logout_redirect_uri'?

Paul
  • 1,224
  • 2
  • 14
  • 31

0 Answers0