问题
I am using Lumen as backend. I successfully authenticated user and got the token, but when I am trying to get protected data, it doesn't let me with Authorization: Bearer TOKEN
. I tried with both Postman & Swift. ( I also tried Authorization: BearerTOKEN
)
I tried making a call from ios app and adding header: Authorization: Bearer y57WWNRNKNpJkXugT6v1YG7Et13PBgT5xNkAB1bg
however it doesn't let me pass the validation. Specifically:
let headers = ["Authorization": "Bearer \(token)"]
Then I tried in postman: GET, set headers:
Authorization
Bearer y57WWNRNKNpJkXugT6v1YG7Et13PBgT5xNkAB1bg
Still no luck. I am getting
error = "access_denied";
"error_description" = "The resource owner or authorization server denied the request.";
P.S: /me?access_token = 84389...
works fine
来源:https://stackoverflow.com/questions/34036781/oauth2-header-authorization-bearer-token-doesnt-work