C
C
carroll2016-09-23 13:18:53
Laravel
carroll, 2016-09-23 13:18:53

Laravel 5.3 Passport (401: Unauthorized) OAuth personal token?

Sending:

authorization: Bearer token
accept: application/json
accept-encoding: gzip, deflate
accept-language: en-US,en;q=0.8
user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36

And I get:
{"error":"Unauthenticated."}
aWRtp.png
Why?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
shelomanovd, 2017-02-13
@shelomanovd

export	const ipDomain = 'http://animeserver/'
// export	const ipDomain = 'http://shelomanovdima.toprf.net/'

export	const clientId = 1

export	const clientSecret = 'shuEn7TZOoPDJpsr649GN0wrwchXCvlJWzj4tBM4'

export	const getHeader = function() {
    var tokenData = JSON.parse(window.localStorage.getItem('authUser'));
      var header = {
        'Accept': 'application/json',
        'Authorization': 'Bearer ' + tokenData.access_token
      }

    return header;
  }

I have this. All OK

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question