Announcements

Help Wizard

Step 1

NEXT STEP

Error 400 : "Only valid bearer authentication supported"

Error 400 : "Only valid bearer authentication supported"

Plan

Premium

Country

Spain

 

I'm getting Error 400 : "Only valid bearer authentication supported" using the access token from /api/token request

 

I have the next flow:

Using the auth sdk in Kotlin to do the /authorize bringing the activity with the 

AuthorizationResponse.Type.CODE

in the params, that has a code in the response that I use in the /api/token request, that gives me an access token that I save for the next request, for example the profile request, with the correct scopes, putting that access code in the header with the next code: 

companion object {
private const val TOKEN_HEADER_KEY = "Authorization"
private const val TOKEN_HEADER_VALUE = "Bearer"
}

override fun intercept(chain: Interceptor.Chain): Response {
val token = getToken()
val original = chain.request()
val requestBuilder = original.newBuilder()
.addHeader(TOKEN_HEADER_KEY, "$TOKEN_HEADER_VALUE $token")
.url(original.url)
val request = requestBuilder.build()
return chain.proceed(request)
}

but this give me the 

 

 

 

 

I/okhttp.OkHttpClient: {
I/okhttp.OkHttpClient:   "error": {
I/okhttp.OkHttpClient:     "status": 400,
I/okhttp.OkHttpClient:     "message": "Only valid bearer authentication supported"
I/okhttp.OkHttpClient:   }
I/okhttp.OkHttpClient: }

 

 

 

 

 

Reply
0 Replies

Suggested posts