Auth0 Home Blog Docs

I can't really logout of my LinkedIn account via Auth0

logout

#1

Once I have login with my linkedIn account, I cannot choose another linkedIn account to sign in again even though I have successfully logout of my application.

Scenario: When I clicked on Login button on my web app, it redirects me to the auth0 authentication page. I clicked on ‘Not my account’ and I suppose to login with another account. However, when I click on Login with LinkedIn, it will automatically use my current sign in account (the account that I have sign in previously).

I have tried to set prompt=true on auth0.authorize(), but it doesn’t work. Also, I have tried federated logout, but it doesn’t work as well.

Could you help me on how to force the user to enter their linkedIn account every time that they sign in through auth0?


#2

Hey there @dev_auth0, I would like to find out more about the situation you are experiencing. Are you seeing any errors in the console or within logs? How do you have the Auth0 platform implemented into your app? Is this issue persistent across all browsers? Thanks in advance!


#3

@James.Morrison I have tried it on both Chrome and Firefox, the results are the same. There are no errors.

I implemented auth0 with auth0-js. I created webAuth as below

myAuth0 = auth0.WebAuth( {
domain:AUTH0_DOMAIN,
clientID: AUTH0_CLIENT_ID,
redirectUri: AUTH0_REDIRECT_URI,
audience: AUTH0_AUDIENCE,
responseType: ‘token id_token’,
scope: ‘openid profile email read:profile write:profile’
} )

then I use

myAuth0.authorize()

this is how I implemented auth0 on my web application.

My current problem is that I can logout successfully on my web application, but once I logout and login again, I will not prompt to enter my linkedIn credential anymore. Auth0 will automatically select the current logged in LinkedIn account on my browser. I am suppose to logout of my application and login back with another linkedin account. It doesn’t work even thought I tried federated logout. Any suggestions? Thanks.


#4

What version of Auth0.js are you using? When you get a minute can you share your tenant with me in a DM? Thanks in advance.


#5

I wanted to follow up @dev_auth0 after working with our support team, they feel the key is ending the auth0 session. This is described in the below documentation but here’s a snippet:

Auth0 session: Auth0 also keep a session for the user and stores their information inside a cookie. The next time a user is redirected to the Auth0 Lock screen, the user’s information will be remembered. To log out a user from Auth0, you need to clear the single sign-on (SSO) cookie.

Please let me know if this helps solve the challenge you’ve been facing.


#6

Hi @dev_auth0. Unfortunately, in the case of LinkedIn connections there are a few limitations that will prevent you from achieving exactly what you want:

  • We don’t support federated logout in LinkedIn, as they don’t provide a way of requesting a logout and send the user back to the requestor (i.e. your application).
  • LinkedIn is not prepared to handle multiple identities (compare to Google, where you can log in with multiple identities), so if the user is already logged in it will use that identity without prompting.
  • LinkedIn does not currently support OAuth2’s prompt=login parameter, which is used to ask the identity provider to re-authenticate the user even if there’s a session in place.

The only workaround that I can suggest is to redirect the user to LinkedIn logout endpoint, https://www.linkedin.com/sales/logout. This can be a harsh user experience, though: you can’t redirect back to your application, and most users will not appreciate being logged out of their social account, so you should at least confirm first with the user.
In general, nowadays, applications that use a social login don’t attempt to terminate the user session with the social identity provider, as the user might be using that session for other tasks.

Hope that clarifies things a bit.


#7

Thank you very much, @nicolas_sabena. It’s very clear to me and it would help a lot.