James
James

Reputation: 2895

OIDC-client Cant log out. Error: no end session endpoint

I am starting to implement a code flow with Auth0 as my identity provider.

The sign in works perfectly and I retrieve a valid token back from Auth0.

The problem: I can't sign out.

Below is the error I am getting.

core.js:9110 ERROR Error: Uncaught (in promise): Error: no end session endpoint
Error: no end session endpoint
    at oidc-client.min.js:1
   ...

Here is my user manager config.

const config = {
    authority: 'https://dev-hidden.eu.auth0.com',
    client_id: '--hidden--',
    redirect_uri: `${window.location.origin}/auth-callback`,
    response_type: 'code',
    scope: 'openid profile',
    automaticSilentRenew: true,
    post_logout_redirect_uri: 'http://localhost:4200/',
    end_session_endpoint: 'https://dev-hidden.eu.auth0.com'
     ^^^ I dont think this does anything but I added it anyway
  };

I have tried the following to sign out, neither worked.

this.userManager.signoutRedirect();
this.userManager.signoutRedirectCallback()

I'm not sure if its a client or an Auth0 issue.

I'm using oidc-client 1.8.2 but have also tried other versions with the same result.

Thanks in advance

Upvotes: 2

Views: 4064

Answers (2)

R. AbuBaker
R. AbuBaker

Reputation: 226

In my case (OpenID Connect + Google) revokeAccessToken() did the trick for me.

Upvotes: 0

Jan Garaj
Jan Garaj

Reputation: 28656

Check https://YOUR_AUTH0_DOMAIN/.well-known/openid-configuration to find end_session_endpoint.

Probably Auth0 doesn't support end_session_endpoint. I checked https://auth-dev.mozilla.auth0.com/.well-known/openid-configuration and there is no end_session_endpoint. But they support revocation_endpoint, which may need different implementation on your end.

Maybe it will be better to use auth0-spa-js for you; doc: https://auth0.com/docs/quickstart/spa/angular2

Upvotes: 2

Related Questions