fivetech fivetech - 4 months ago 60
Java Question

How can I invalidate access token from Linkedin to sign out ?

My application sign in to LinkedIn successfully using OAuth 2.0. However, I cannot find a way to sign out. I have searched on the web I need to delete access token from my application. My application uses scribejava library.

Answer

Check this answer, it should solve your issues:

Unable to logout from linkedin using javascript api

Code sample from answer:

<script type="text/javascript" src="http://platform.linkedin.com/in.js">
  api_key: mykey
  authorize: true
  onLoad: onLoad
</script>

<script type="text/javascript">
function onLoad() {
  try {
    IN.User.logout();
  } catch (err) {
    console.log(err);
  }
  setTimeout("goToHome()", 10000);
}

function goToHome() {
  location.href="index.php";
}
</script>