1
votes

I have my web app where I use the "sign in with slack" button for users to access slack from my app,now I'm trying to logout the user automatically from slack when the user logouts out from my web app, but there is no documentation like "sign out of slack".

I have tried multiple ways to sign out that includes revoking auth code, but no luck finding a solution to this problem.

1
Hey there. Quick question. Why do you want to revoke the auth token? The token you get from sign-in can not do anything except confirm the identity of the user. So why not just discard it?Erik Kalkoken
I'm don't know how to discard the token, also revoking auth token was the only way I could think of but that didn't work eitherReynold Dmello
By discarding I mean deleting it from your database / your storage in your app. Obviously the user does not have the actual token, so deleting it in your app should be enough to discard it.Erik Kalkoken
Thanks, I will try using that method.Reynold Dmello

1 Answers

-1
votes

There are a few ways you can do this, sign out when the browser is closed, but this depends on how you're using cookies.

  1. Use Cookieless=True
  2. User a JavaScript approach to remove the cookie on window.unload

Cookieless=True

<system.web>
  <authentication mode="Forms">
    <forms loginUrl="/Account/Login"
           protection="All"
           cookieless="true" //set to true   
  </authentication>
</system.web>

Javascript

window.addEventListener('unload', function(event) {
   document.cookie = name + '=; expires=Thu, 01 Jan 1970 00:00:01 GMT;';
});