spotify-web-api-kotlin icon indicating copy to clipboard operation
spotify-web-api-kotlin copied to clipboard

[Android] Using PKCE Authentication, the token scopes appears empty

Open yannallain opened this issue 2 years ago • 1 comments

Hello,

Perhaps I'm missing something but I was trying to debug an issue while implementing the PKCE authentication from the library and, while logging the scopes of the API, I saw that the scopes were empty even though they were provided in the SpotifyPkceLoginActivityImpl.scopes property.

I also reproduced these empty scopes in the Android demo app

Issue: Token scopes of the API are empty When I want to check the scopes of the current api token, the scopes are always at null even if in the SpotifyPkceLoginActivityImpl all the list of available SpotifyScope is passed as override val scopes = SpotifyScope.values().toList()

Hence, for example, calling api.hasScope(SpotifyScope.PLAYLIST_READ_PRIVATE) always return false.

To Reproduce Steps to reproduce the behavior:

  1. Install the Android demo app
  2. Login with the PKCE method.
  3. Add some logs of the api.token.scopes.

Expected behavior The list of scopes is available from the api.token.scopes or from api.hasScope(SpotifyScope.*)

Smartphone:

  • Device: [OnePlus 9]
  • OS: [Android 12]

yannallain avatar May 19 '22 23:05 yannallain

Yep, this is definitely an issue! The token string is not stored. Thank you for reporting this

adamint avatar Aug 01 '22 01:08 adamint