1

When a user revisits my website, which makes connection to the Spotify web api, the user gets automatically signed in to the Spotify service.

Now I want a log out button on my site, so the user is forced to enter his/her credentials again, so the user can use different credentials for another Spotify account.

How can I accomplish that? Adding show_dialog=true won't log out the user, but only askes the user to give permission to the Spotify service to use some scopes. I need to clear the session, but don't know how I can clear a session from code (C#).

Swerfer
  • 345
  • 1
  • 9

1 Answers1

1

This is a more generic question and good answer to how to logout of OAuth2: How to Logout of an Application Where I Used OAuth2 To Login With Google?

For Spotify specifically, there is a similar link that you can link to, that will log out the current user from the Spotify web site: https://www.spotify.com/logout/

This means of course that you can't login as two different spotify users in two different apps in the same web session. If you are ok with this, it should work.

The link also doesn't allow for anyone to get to redirect back to their site as far as I know. The page does allow for redirects, but it seems to only certain predefined sites. Check out the logout button on the community site: https://community.spotify.com/

Community
  • 1
  • 1
jooon
  • 1,931
  • 14
  • 24