3

I am trying to login to spotify. Although when the app is installed it always throws an AUTHENTICATION_SERVICE_UNAVAILABLE error. If the app is uninstalled the default Webview opens where the login works fine. Wished behaviour is, that the app opens and the user can login from there.

    public void doSpotifyLogin(boolean trySpotifyAgain) {
    this.trySpotifyAgain = trySpotifyAgain;
    AuthorizationRequest.Builder builder =
            new AuthorizationRequest.Builder(CLIENT_ID, AuthorizationResponse.Type.TOKEN, REDIRECT_URI);
    builder.setScopes(new String[]{"user-read-private", "streaming", "playlist-read-private", "user-library-read"});
    AuthorizationRequest request = builder.build();

    AuthorizationClient.openLoginActivity(this, SPOTIFY_LOGIN_REQUEST_CODE, request);
}

This is the response I am getting from the API:

2021-12-22 11:36:29.802 5069-5069/? I/com.spotify.sdk.android.auth.LoginActivity: Spotify auth completing. The response is in EXTRA with key 'response'
2021-12-22 11:36:29.822 5069-5069/? D/StartActivity: Spotify error: AUTHENTICATION_SERVICE_UNAVAILABLE

If you need any further information, please let me know! Thanks in advance

robot_
  • 41
  • 1
  • 6
  • I'm getting the same "AUTHENTICATION_SERVICE_UNAVAILABLE" exception. Ironically, it worked without having anything changed for months before. Another app with Spotify authentication works fine and still authenticates. – Maximilian Keppeler Dec 26 '21 at 14:07
  • Really strange. I know this has worked before too, but I haven't found a solution yet to fix it. – robot_ Dec 27 '21 at 08:55
  • Spend quite some days on it. Still couldn't find a solution yet.. – Maximilian Keppeler Jan 02 '22 at 10:31
  • Me neither. Guess I'll have to use the web login for now... – robot_ Jan 03 '22 at 08:24
  • I have just encountered this error. It turned out that I changed my app suffix before, re-added the fingerprint to the Spotify Developer Dashboard and it's working again. – Hellious Feb 24 '22 at 07:08
  • 1
    I struggled with this and fixed it when I added the correct package name and fingerprint to the developer.spotify.com app settings. "AUTHENTICATION_SERVICE_UNAVAILABLE" is a horrible error name for this. – Ronze Mar 14 '22 at 12:14

3 Answers3

1

For me, the issue got resolved after I added the SHA1 key generated on a new mac to the Spotify app dashboard

Levon Petrosyan
  • 8,815
  • 8
  • 54
  • 65
0

Ronze's comment worked for me. I needed to update my app's package name on developer.spotify.com.

kuroki
  • 361
  • 1
  • 3
  • 3
  • Nice. Turning a comment into a confirmed and clearly attributed answer is appreciated. You might want to include all the details of the comment (just because theoretically comments might get deleted at some point). – Yunnosch May 14 '22 at 05:19
0

My android package and SHA1 fingerprint were correct. I tried removing user-read-birthdate permission from the authentication request and it worked for me!

Migueltejo
  • 26
  • 3