adamint / spotify-web-api-kotlin

Spotify Web API wrapper for Kotlin, Java, JS, and Native - Targets JVM, Android, JS (browser), Native (Desktop), and Apple tvOS/iOS. Includes a Spotify Web Playback SDK wrapper for Kotlin/JS, and a spotify-auth wrapper for Kotlin/Android.
https://adamint.github.io/spotify-web-api-kotlin-docs/
MIT License
194 stars 21 forks source link

I want to avoid duplicate logins. #292

Closed swy0710 closed 3 years ago

swy0710 commented 3 years ago

I am trying to authenticate using pkce, but for that, it says that I have to inherit AbstractSpotifyPkceLoginActivity. If I inherit and execute AbstractSpotifyPkceLoginActivity, the activity for login is executed even if I am already logged in in the spotify app. Are there any ways to make them work together? (meaning that I want to skip login if i am already logged in in the spotify app)

adamint commented 3 years ago

I responded on Discord as well, but for others that run into this issue: PKCE auth is incompatible with Spotify SSO (sign-on using the app). This is what you should use implicit auth for. The reason why PKCE auth is typically recommended is that it doesn't rely on installation of the Spotify app, and so token handling and refresh is done entirely within the context of your app. But... when convenience is a relevant concern, that's why the library wraps the spotify-auth library :)

swy0710 commented 3 years ago

Thank you for quick response. Let me use implicit auth.