spotify / android-sdk

Spotify SDK for Android
https://developer.spotify.com/documentation/android/
Apache License 2.0
454 stars 117 forks source link

AccountsPrefligtRequest failed with status code: 400 #272

Closed birdeveloper closed 3 years ago

birdeveloper commented 3 years ago

SDK Version: auth: 1.2.3 app-remote: 0.7.1

OS Version: Android 5.0 and above on all versions

Steps to reproduce: Do the following call once:

private fun getAuthenticationRequest(type: AuthorizationResponse.Type): AuthorizationRequest {

    return AuthorizationRequest.Builder(CLIENT_ID, type, getRedirectUri().toString())
            .setScopes(arrayOf("user-follow-read","user-read-email","user-read-private","app-remote-control","streaming","user-modify-playback-state","user-read-currently-playing","user-read-recently-played","user-top-read"))
        .setShowDialog(true)
        .build()
}

Expected behaviour: The onActivityResult function needs to successfully return the access token to me. Interacting with the spotify app and getting permission screen does not open

Actual behaviour: It shows a log record with just one Error tag without any display on the screen.

E/Spotify: [OkHttp https://accounts.spotify.com/...] AccountsPrefligtRequest failed with status code: 400

Additional information that might be valuable: I have no problem with errors received for the birthdate scope previously presented. So I don't use it. My application does not have any errors in debug state. But when it is released on Play Store, I get this error.

birdeveloper commented 3 years ago

I selected my app from the Play Console account. I have come to the Version> Setup> Application Signing Page. I copied the SHA-1 certificate fingerprint and placed it in the relevant part of the Spotify developer account. And there is no longer a problem.