How to sign out a user from LinkedIn?

23 posts / 0 new
Last post
J.Vignesh Kumaran's picture
Joined: 2009-12-01
Dec 16, 2009
How to sign out a user from LinkedIn?

Hi all,   Whether there is any API to sign out the user who have signed in Linked?   If so, can you please give me the documentation path for it.   If not,        whether there is any idea about adding it in future        whether there is any procedure similar to Authorization procedure to sign out,thanks in advance,regards,Vignesh

Anonymous (not verified)
Dec 16, 2009

There's no API to explicitly expire your access token -- it's under complete control of the user. They can decide whether to enable the access token for a duration of time when they give your app permission in the authorization stage, or they can manually reject acccess to your application through an interace on in Accounts & Settings.What would your use case be for having it be a programmatic action?Taylor

J.Vignesh Kumaran's picture
Joined: 2009-12-01
Dec 16, 2009

Thanks for your reply Taylor.It is till under discussion, have to finalize.My cases are 1. if the user has select 'Grant duration' as 'Until Revoked', and trying to close the application 2. if the user trying to close the application before selected 'Grant duration' time completes (ie., before accesstoken expires)  how i can make the accesstoken expire programmatically?If you give any suggestions, it will be really helpful.thanks,Vignesh

J.Vignesh Kumaran's picture
Joined: 2009-12-01
Dec 16, 2009

Hi Taylor,   Also, i have to know what will be the response i will get when i use expired accesstoken in the resource requestthanks in advance,Vignesh.

Joined: 2009-11-24
Dec 16, 2009

Hi there,As I understand it, LinkedIn will not consider you to be 'logged in' whilst using your app. The initial authorisation gives the app permission to access your account for a specified time period. Each API call must reference the token and token secret to identify itself with the authorisation which has been given. I don't see a need to sign out when your app closes. It sounds as though you want to force authorization evey time your app is used, but this is really up to the user and the time period they select.If you make an API call using a token and token secret which have expired (if, for example, the user authorised your app for one day, two days ago) then you'll get a '401 - Unauthorized' response.Taylor - please correct me if I'm wrong.RegardsAlec

J.Vignesh Kumaran's picture
Joined: 2009-12-01
Dec 17, 2009

Thanks for your reply Alec.I got it now. So if we are making the user to signout (but not closing the app) then we can reset the accesstoken which was used to make resource request for the user, then everything will be get solved.Is it correct?regards,Vignesh

Joined: 2009-11-24
Dec 17, 2009

Vignesh,If I've understood you correctly then yes - you can force the user of your app to re-authenticate by discarding the access token and token secret. They will then need to authorise your app again in order to get a new one before being able to make any more API calls successfully.I wouldn't expect this to give them the best user experience though, especially if they selected to authorise your app for a month, or 'until revoked'. In this case they wouldn't expect to have to authenticate again. Then again perhaps you're doing something that makes this necessary.Hope this helpsAlec

J.Vignesh Kumaran's picture
Joined: 2009-12-01
Dec 17, 2009

Thank you for your reply Alec.The point what you have given seems to be valid and made me to think once again. Thanks a lot once again.regards,Vignesh.

Atul Arora's picture
Joined: 2010-12-01
Dec 1, 2010

Hi Vignesh,Can you pls help me how to signout linkedin app using oauth in in advanceRegards,Atul

Joined: 2011-01-24
Mar 10, 2011

Hello Alec,I need the same feature to forcefully logout one user using oAuth API in ASP.NET.My scenario is little bit differnt though.a) A user "Jobn Smith" uses my application and gave successfully authorization to my application.. fine the access tokens are persisted in my App database, so i can reuse it next time for the same candidate(best user experience perspective) . Fine. He closed all browsers and went away. (please note here without logging out from Linked In)b) Now, another user "Scott Tiger" comes in to the same pc and uses my App and is trying to authorize my app in which he/she is presented by Linked In ,Continue,RevokePermission,Cancel buttons mentioning previous user(a) name and my App name, since the previous user log on credentials saved in browser cookies by LIn.THis is not best user experiece for the second user and most of all a security concern for the fist user ; my app looses credibility by posing this kind of vulnerability.How do we over come situation b) , or is there any API methods available to forecfully logout(behind the scene) or clear out cookies?Appreciate your earliest response.

naresh jonnala's picture
Joined: 2010-04-23
Mar 10, 2011

i hope there is no way to distory browser session using any program.this may help you.Using javascript:Where ever you want you can use these 2 lines of code.var img = new Image();img.src = '';

Joined: 2010-10-07
Oct 20, 2010

How can I logout from linkedin ,I am using javascript API for my login process.

Ernest Sim's picture
Joined: 2011-09-23
Nov 18, 2011

naresh thanks for that coding, helped alot :)

Joined: 2012-03-28
Apr 3, 2012

I am trying to logout a user from linkedIn as soon as he logs out from my site. I am using Javascript Api for Sign In with linkedIn. Please suggest me on how to do this..Regards...

Kirsten Hunter's picture
Joined: 2011-06-30
Apr 4, 2012

This is the REST forum, but for the Javascript API this is covered here:

Joined: 2012-06-01
Jul 11, 2012

thank you naresh , your code is working

Ali Raza's picture
Joined: 2012-08-23
Aug 23, 2012

How can i sign out from linked in when i open my account automatically signed in
and there is no option for sigh out

Joined: 2012-10-17
Oct 17, 2012

I am trying to logout a linkedin user from linkedin integrated android application. I am using invalidateAccessToken() to logout but unable to do so.Please help me..

Joined: 2012-09-24
Oct 25, 2012

hi how to logout from linkedin there is no signout button for that but i have singout button for google account.please help me

Joined: 2012-12-17
Dec 17, 2012

how to log out from linkedin

Kamyar Mohager's picture
LinkedIn Employee
Joined: 2012-04-04
Dec 18, 2012

Why not just delete their access token? The next time the user attempts to use your application, they'll need to re-authenticate (effectively logging them out of your app).

For those that need to log out of the actual website, this is the wrong forum. You'll need to contact our customer support if you're having issues logging out:


Joined: 2013-03-28
Mar 28, 2013

which you given that code not working Mozilla..Plz help me to clear browser session.

Joined: 2013-03-31
Apr 9, 2013

Thanks naresh for your URL. It helps me a lot. :)