Announcements

Help Wizard

Step 1

NEXT STEP

[Android] User authorization stopped working after serveral months on different devices

[Android] User authorization stopped working after serveral months on different devices

Body:

Plan

Premium

Country

Germany


Device

Samsung Galaxy S10e

Operating System

Android 11


My Question or Issue

I've used the SpotifyAppRemote connection (SpotifyAppRemote.connect) and the AuthorizationClient (AuthorizationClient.openLoginActivity) to connect to the Spotify App and the Web API.
A have registered an app in development state. It worked fine for me and another test user for about 4 months (without changing the app). Since October I see a very strange behaviour and I found no solution:


Steps:

1. Login to Spotify App
2. Launch my app
3. connect to SpotifyAppRemote
4. user authorization screen is shown, approving
5. connection established, reconnecting works, subscribing to events works, skipping tracks, playing tracks works, closing and opening the app works
6. connecting to the WebAPI via AuthorizationClient
7. user authorization screen is shown, approving
8. All queries work
9. closing and re-opening the connection works
10. ~30 minutes of inactivity in the Spotify or forcefully closing the Spotify App and re starting it
11. SpotifyAppRemote shows:
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"}
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"}
at com.spotify.android.appremote.api.LocalConnector.asAppRemoteException(LocalConnector.java:143)
at com.spotify.android.appremote.api.LocalConnector.access$000(LocalConnector.java:34)
at com.spotify.android.appremote.api.LocalConnector$1.onConnectionFailed(LocalConnector.java:117)
at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:162)
at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:95)
at android.os.AsyncTask.finish(AsyncTask.java:771)
at android.os.AsyncTask.access$900(AsyncTask.java:199)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8595)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
Caused by: com.spotify.protocol.client.error.RemoteClientException: {"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"}
at com.spotify.protocol.client.RemoteWampClient.getRemoteClientException(RemoteWampClient.java:139)
at com.spotify.protocol.client.RemoteWampClient.access$200(RemoteWampClient.java:16)
at com.spotify.protocol.client.RemoteWampClient$1.onAbort(RemoteWampClient.java:44)
at com.spotify.protocol.client.WampRouterImpl.routeAbort(WampRouterImpl.java:100)
at com.spotify.protocol.client.WampRouterImpl.route(WampRouterImpl.java:26)
at com.spotify.protocol.client.AppProtocolCommunicator.onData(AppProtocolCommunicator.java:78)
at com.spotify.android.appremote.internal.RemoteServiceIo.handleMessage(RemoteServiceIo.java:111)
at com.spotify.android.appremote.internal.RemoteServiceIo.access$000(RemoteServiceIo.java:45)
at com.spotify.android.appremote.internal.RemoteServiceIo$IncomingHandler.handleMessage(RemoteServiceIo.java:89)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8595)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)
12. AuthorizationClient also fails
val response: AuthorizationResponse = AuthorizationClient.getResponse(resultCode, intent)
response.error is "AUTHENTICATION_SERVICE_UNAVAILABLE"
13. Restarting the app has no effect
14. After using "logout" in the Spotify App and logging in again everything works again and it is back in step 1


I have tried the following which did not work:

  • forcefully close and restart my app
  • delete all data from my app
  • clear all data of the Spotify app
  • forcefully close and restart Spotify app
  • Restart the phone
  • use a different user account on a different device
  • register a new app in the Spotify Developer Dashboard


(When I am in the "error state" and I use AuthorizationClient.openLoginInBrowser a URI is opened containing a token)

 

Thank you for your support!

Reply
0 Replies

Suggested posts