Authentication Token request return null access token with response type is empty
Issue found on 19 August 2024.
SDK Version:
com.spotify.android:auth:1.2.3
OS Version:
Android 13
Scope(s):
user-read-recently-played
Steps to reproduce:
- Request access token with auth api
val builder = AuthorizationRequest.Builder(context.getString(R.string.spotify_client_id),
AuthorizationResponse.Type.TOKEN, context.getString(R.string.spotify_callback_uri)
)
builder.setScopes(arrayOf("user-read-recently-played"))
AuthorizationClient.openLoginActivity(activity, SPOTIFY_LOGIN_REQUEST_CODE, builder.build() )
- Get the response from on activity result
if(requestCode == Constants.SPOTIFY_LOGIN_REQUEST_CODE && resultCode == Activity.RESULT_OK) {
val response = AuthorizationClient.getResponse(resultCode, intent)
val token = response.accessToken
when(response.type) {
AuthorizationResponse.Type.TOKEN -> {
val accessToken = response.accessToken
Log.d("token", accessToken)
}
AuthorizationResponse.Type.EMPTY -> {
Log.d("empty", "empty")
}
- Client ID and callback uri has been checked match from dashboard values.
Expected behaviour: response Type is TOKEN
Actual behaviour: response Type is EMPTY
Having the same issue, did you fix it ? :)
Hi, no:) it’s impossible unfortunately. Ask developers do not maintain it
Le sam. 18 janv. 2025 à 15:38, QuentinSuchet @.***> a écrit :
Having the same issue, did you fix it ? :)
— Reply to this email directly, view it on GitHub https://github.com/spotify/android-sdk/issues/366#issuecomment-2599681609, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEAZTNTEHKM6FUNR2RRWPT2LI4KXAVCNFSM6AAAAABMW7T72WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJZGY4DCNRQHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
*sdk developers
Le sam. 18 janv. 2025 à 15:39, Axel Stein @.***> a écrit :
Hi, no:) it’s impossible unfortunately. Ask developers do not maintain it
Le sam. 18 janv. 2025 à 15:38, QuentinSuchet @.***> a écrit :
Having the same issue, did you fix it ? :)
— Reply to this email directly, view it on GitHub https://github.com/spotify/android-sdk/issues/366#issuecomment-2599681609, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEAZTNTEHKM6FUNR2RRWPT2LI4KXAVCNFSM6AAAAABMW7T72WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJZGY4DCNRQHE . You are receiving this because you are subscribed to this thread.Message ID: @.***>
Got it working by using an ActivityResultContracts instead of the old OnActivityResult provided in the documentation and sample app :)
Wow, thank you! I’ll give it a try
Le sam. 18 janv. 2025 à 18:06, QuentinSuchet @.***> a écrit :
Got it working by using an ActivityResultContracts instead of the old OnActivityResult provided in the documentation and sample app :)
— Reply to this email directly, view it on GitHub https://github.com/spotify/android-sdk/issues/366#issuecomment-2599730534, or unsubscribe https://github.com/notifications/unsubscribe-auth/ADEAZTK7COD2JIM5Z3CZGE32LJNXJAVCNFSM6AAAAABMW7T72WVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKOJZG4ZTANJTGQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>