android-sdk icon indicating copy to clipboard operation
android-sdk copied to clipboard

UserNotAuthorizedException from new application and no Auth View or flow

Open GitHubHQ opened this issue 8 months ago • 1 comments

Going through the android quickstart tutorial with a brand new app, like many other posters here with no working solutions, I am getting the following error:

com.spotify.android.appremote.api.error.UserNotAuthorizedException: {"message":"Explicit user authorization is required to use Spotify. The user has to complete the auth-flow to allow the app to use Spotify on their behalf"}

I have registered an application in spotify dashboard and:

  1. using the clientId
  2. whitelisted a redirect uri of the format someprefixhere://callback and am using that in the code as well (copy pasted so guaranteed to match)
  3. added my package name (applicationId) as well as my SHA1 fingerprint (via debug signing config)
  4. Set showAuthView(true)
  5. Followed the rest of the tutorial to call SpotifyAppRemote.connect(...) onCreate and on a button press

With the above setup, no matter how many times I try I get the error I mentioned and no auth flow is ever shown.

I have tried the sample app which does work, and copied over all the credentials including client id, redirect uri, SHA1 fingerprint and package name, but that does not work when used in my application.

I have also tried to use the Authorization library, which IS able to show the authorization flow SOMETIMES, but only if I use a properly formatted url for redirect uri such as https://example.org/callback rather than the deeplink schema, and only after i force stop the spotify app.

Furthermore, after authorization via auth library, the app remote library works as expected in terms of media controls/playback

Any help is appreciated T-T

GitHubHQ avatar Apr 22 '25 22:04 GitHubHQ

same issue, any update sir?

Autines avatar Aug 08 '25 02:08 Autines