Oauth2 Header - “Authorization: Bearer (token)” doesn't work

Refresh

November 2018

Views

1.8k time

2

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

0 answers