<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic [Android] User authorization stopped working after serveral months on different devices in Spotify for Developers</title>
    <link>https://community.spotify.com/t5/Spotify-for-Developers/Android-User-authorization-stopped-working-after-serveral-months/m-p/5278504#M3409</link>
    <description>&lt;P&gt;Body:&lt;/P&gt;&lt;P&gt;Plan&lt;/P&gt;&lt;P&gt;Premium&lt;/P&gt;&lt;P&gt;Country&lt;/P&gt;&lt;P&gt;Germany&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Device&lt;/P&gt;&lt;P&gt;Samsung Galaxy S10e&lt;/P&gt;&lt;P&gt;Operating System&lt;/P&gt;&lt;P&gt;Android 11&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My Question or Issue&lt;/P&gt;&lt;P&gt;I've used the SpotifyAppRemote connection (SpotifyAppRemote.connect) and the AuthorizationClient (AuthorizationClient.openLoginActivity) to connect to the Spotify App and the Web API.&lt;BR /&gt;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:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Steps:&lt;/P&gt;&lt;P&gt;1. Login to Spotify App&lt;BR /&gt;2. Launch my app&lt;BR /&gt;3. connect to SpotifyAppRemote&lt;BR /&gt;4. user authorization screen is shown, approving&lt;BR /&gt;5. connection established, reconnecting works, subscribing to events works, skipping tracks, playing tracks works, closing and opening the app works&lt;BR /&gt;6. connecting to the WebAPI via AuthorizationClient&lt;BR /&gt;7. user authorization screen is shown, approving&lt;BR /&gt;8. All queries work&lt;BR /&gt;9. closing and re-opening the connection works&lt;BR /&gt;10. ~30 minutes of inactivity in the Spotify or forcefully closing the Spotify App and re starting it&lt;BR /&gt;11. SpotifyAppRemote shows:&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;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"}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;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"}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.api.LocalConnector.asAppRemoteException(LocalConnector.java:143)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.api.LocalConnector.access$000(LocalConnector.java:34)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.api.LocalConnector$1.onConnectionFailed(LocalConnector.java:117)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:162)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:95)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.AsyncTask.finish(AsyncTask.java:771)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.AsyncTask.access$900(AsyncTask.java:199)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.Handler.dispatchMessage(Handler.java:106)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.Looper.loop(Looper.java:246)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.app.ActivityThread.main(ActivityThread.java:8595)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at java.lang.reflect.Method.invoke(Native Method)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;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"}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.RemoteWampClient.getRemoteClientException(RemoteWampClient.java:139)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.RemoteWampClient.access$200(RemoteWampClient.java:16)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.RemoteWampClient$1.onAbort(RemoteWampClient.java:44)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.WampRouterImpl.routeAbort(WampRouterImpl.java:100)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.WampRouterImpl.route(WampRouterImpl.java:26)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.AppProtocolCommunicator.onData(AppProtocolCommunicator.java:78)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.internal.RemoteServiceIo.handleMessage(RemoteServiceIo.java:111)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.internal.RemoteServiceIo.access$000(RemoteServiceIo.java:45)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.internal.RemoteServiceIo$IncomingHandler.handleMessage(RemoteServiceIo.java:89)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.Handler.dispatchMessage(Handler.java:106) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.Looper.loop(Looper.java:246) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.app.ActivityThread.main(ActivityThread.java:8595) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at java.lang.reflect.Method.invoke(Native Method) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130) &lt;/FONT&gt;&lt;BR /&gt;12. AuthorizationClient also fails&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;val response: AuthorizationResponse = AuthorizationClient.getResponse(resultCode, intent)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;response.error is "AUTHENTICATION_SERVICE_UNAVAILABLE"&lt;/FONT&gt;&lt;BR /&gt;13. Restarting the app has no effect&lt;BR /&gt;14. After using "logout" in the Spotify App and logging in again everything works again and it is back in step 1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried the following which did not work:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;forcefully close and restart my app&lt;/LI&gt;&lt;LI&gt;delete all data from my app&lt;/LI&gt;&lt;LI&gt;clear all data of the Spotify app&lt;/LI&gt;&lt;LI&gt;forcefully close and restart Spotify app&lt;/LI&gt;&lt;LI&gt;Restart the phone&lt;/LI&gt;&lt;LI&gt;use a different user account on a different device&lt;/LI&gt;&lt;LI&gt;register a new app in the Spotify Developer Dashboard&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;(When I am in the "error state" and I use AuthorizationClient.openLoginInBrowser a URI is opened containing a token)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your support!&lt;/P&gt;</description>
    <pubDate>Sun, 17 Oct 2021 11:29:38 GMT</pubDate>
    <dc:creator>bs_dev</dc:creator>
    <dc:date>2021-10-17T11:29:38Z</dc:date>
    <item>
      <title>[Android] User authorization stopped working after serveral months on different devices</title>
      <link>https://community.spotify.com/t5/Spotify-for-Developers/Android-User-authorization-stopped-working-after-serveral-months/m-p/5278504#M3409</link>
      <description>&lt;P&gt;Body:&lt;/P&gt;&lt;P&gt;Plan&lt;/P&gt;&lt;P&gt;Premium&lt;/P&gt;&lt;P&gt;Country&lt;/P&gt;&lt;P&gt;Germany&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Device&lt;/P&gt;&lt;P&gt;Samsung Galaxy S10e&lt;/P&gt;&lt;P&gt;Operating System&lt;/P&gt;&lt;P&gt;Android 11&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;My Question or Issue&lt;/P&gt;&lt;P&gt;I've used the SpotifyAppRemote connection (SpotifyAppRemote.connect) and the AuthorizationClient (AuthorizationClient.openLoginActivity) to connect to the Spotify App and the Web API.&lt;BR /&gt;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:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Steps:&lt;/P&gt;&lt;P&gt;1. Login to Spotify App&lt;BR /&gt;2. Launch my app&lt;BR /&gt;3. connect to SpotifyAppRemote&lt;BR /&gt;4. user authorization screen is shown, approving&lt;BR /&gt;5. connection established, reconnecting works, subscribing to events works, skipping tracks, playing tracks works, closing and opening the app works&lt;BR /&gt;6. connecting to the WebAPI via AuthorizationClient&lt;BR /&gt;7. user authorization screen is shown, approving&lt;BR /&gt;8. All queries work&lt;BR /&gt;9. closing and re-opening the connection works&lt;BR /&gt;10. ~30 minutes of inactivity in the Spotify or forcefully closing the Spotify App and re starting it&lt;BR /&gt;11. SpotifyAppRemote shows:&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;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"}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;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"}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.api.LocalConnector.asAppRemoteException(LocalConnector.java:143)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.api.LocalConnector.access$000(LocalConnector.java:34)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.api.LocalConnector$1.onConnectionFailed(LocalConnector.java:117)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:162)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.internal.SdkRemoteClientConnector$ConnectionTask.onPostExecute(SdkRemoteClientConnector.java:95)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.AsyncTask.finish(AsyncTask.java:771)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.AsyncTask.access$900(AsyncTask.java:199)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:788)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.Handler.dispatchMessage(Handler.java:106)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.Looper.loop(Looper.java:246)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.app.ActivityThread.main(ActivityThread.java:8595)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at java.lang.reflect.Method.invoke(Native Method)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;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"}&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.RemoteWampClient.getRemoteClientException(RemoteWampClient.java:139)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.RemoteWampClient.access$200(RemoteWampClient.java:16)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.RemoteWampClient$1.onAbort(RemoteWampClient.java:44)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.WampRouterImpl.routeAbort(WampRouterImpl.java:100)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.WampRouterImpl.route(WampRouterImpl.java:26)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.protocol.client.AppProtocolCommunicator.onData(AppProtocolCommunicator.java:78)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.internal.RemoteServiceIo.handleMessage(RemoteServiceIo.java:111)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.internal.RemoteServiceIo.access$000(RemoteServiceIo.java:45)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.spotify.android.appremote.internal.RemoteServiceIo$IncomingHandler.handleMessage(RemoteServiceIo.java:89)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.Handler.dispatchMessage(Handler.java:106) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.os.Looper.loop(Looper.java:246) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at android.app.ActivityThread.main(ActivityThread.java:8595) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at java.lang.reflect.Method.invoke(Native Method) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:602) &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier" size="2"&gt;at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130) &lt;/FONT&gt;&lt;BR /&gt;12. AuthorizationClient also fails&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;val response: AuthorizationResponse = AuthorizationClient.getResponse(resultCode, intent)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="courier new,courier"&gt;response.error is "AUTHENTICATION_SERVICE_UNAVAILABLE"&lt;/FONT&gt;&lt;BR /&gt;13. Restarting the app has no effect&lt;BR /&gt;14. After using "logout" in the Spotify App and logging in again everything works again and it is back in step 1&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have tried the following which did not work:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;forcefully close and restart my app&lt;/LI&gt;&lt;LI&gt;delete all data from my app&lt;/LI&gt;&lt;LI&gt;clear all data of the Spotify app&lt;/LI&gt;&lt;LI&gt;forcefully close and restart Spotify app&lt;/LI&gt;&lt;LI&gt;Restart the phone&lt;/LI&gt;&lt;LI&gt;use a different user account on a different device&lt;/LI&gt;&lt;LI&gt;register a new app in the Spotify Developer Dashboard&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;(When I am in the "error state" and I use AuthorizationClient.openLoginInBrowser a URI is opened containing a token)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your support!&lt;/P&gt;</description>
      <pubDate>Sun, 17 Oct 2021 11:29:38 GMT</pubDate>
      <guid>https://community.spotify.com/t5/Spotify-for-Developers/Android-User-authorization-stopped-working-after-serveral-months/m-p/5278504#M3409</guid>
      <dc:creator>bs_dev</dc:creator>
      <dc:date>2021-10-17T11:29:38Z</dc:date>
    </item>
  </channel>
</rss>

