Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication Token request return null access token with response type is empty #366

Open
muyassar opened this issue Aug 19, 2024 · 0 comments

Comments

@muyassar
Copy link

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:

  1. 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() )
  1. 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")
                }
  1. Client ID and callback uri has been checked match from dashboard values.

Expected behaviour: response Type is TOKEN

Actual behaviour: response Type is EMPTY

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant