1

We are using the Spotify API and are adding a call which requires to change the authorization scope (adding; user-library-modify).

We don't want to disconnect all our user's tokens when deploying this feature. Is it possible the get the current user's authorized scopes so we can ask them to update permissions if applicable?

Martin de Keijzer
  • 382
  • 1
  • 3
  • 19
  • I don't think there's a way to directly get that information, but you could test for the scope you want to add. If you want to add `user-read-email`, for example, test whether it's granted by reading `api.spotify.com/v1/me` and seeing what data/errors come back. – Steve Blackwell Mar 19 '18 at 02:51

1 Answers1

0

For getting scopes you can use:

    AuthenticationRequest request = builder.build();

    String str[] = request.getScopes();

    for(int i = 0; i < str.length; i++)
    {
        Log.d("TAG", "Scope:" + str[i]);
    }

But i don't know if it possible to get scopes from user becasue all those information are decoded in token, so I think, the only way to get it is encode the token. But maybe I am wrong