Using laravel passport in order to authenticate user I'm passing Authorization key in header as show below.
Authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJS...
when I run API in postman and log the request header what I get is below.
"authorization" => array:1 [
0 => "Bearer eyJ0eXAiOiJKV1Qi...
]
That is good but when the android app sends authorization key in the header it looks like this.
'authorization' =>
array (
0 => 'Bearer "eyJ0eXAiOiJKV1QiLCJhbGciOiJS..."',
),
As you can see a difference that when I get a token from the app it's added " " around the original token. App using Retrofit I don't know what is Retrofit but android developer told me.
and android developer told me that when we concate 2 strings (Bearer and token) it's by default take double quote " ".
So I think there is 2 solution one is from the Android side that they need to figure out something and one solution is to remove Bearer word from token so android developers don't need to merge 2 string.
So is there any way to remove Bearer word from token?
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire