I am bulding a mobile app and I know there are a lot of these questions and I went trough them all, but i still got this problem (Using Magento 2.2.2). I tried with curl, postman, hurl.it and i get this message

message : "Consumer is not authorized to access %resources" parameters : {resources: "self"}

This is my request (Postman)

GET /rest/V1/customers/me HTTP/1.1
Host: myshop.dev
Authorization: Bearer grw5y9b3se261541evcdl1js8jd27c8f
Cache-Control: no-cache

What i did so far:

  • I did put space on Bearer grw5y9b3se261541evcdl1js8jd27c8f
  • Checked everything multiple times (letter by letter)

Further explanation:

This is a new installation of Magento with sample data. I have read the documentation here http://devdocs.magento.com/guides/v2.0/get-started/authentication/gs-authentication-token.html , and i am doing it using Customer access tokens. (Since i am doing a mobile app i chose this way) I also registered/created a customer and with his email / password i am doing the following:

(Curl example)

curl -X POST "http://myshop.dev/rest/V1/integration/customer/token" -H "Content-Type:application/json" -d "{"username":"[email protected]", "password":"customer1pw"}"

and that returns me token, with it i am trying to do a request (see Postman request) to see user data, but with no success. Am i missing something here? Something in apache, php? or am i doing something wrong.


Since nothing worked I deleted Magento and did a fresh installation again, and now it works, I didn't do anything different than before, and that is very confusing.

  • Are you sure that user have role with access to this resource?? Feb 1, 2018 at 13:47
  • I created this customer and i am using his data to get customer token ( If i figured out correctly ) then to get his data. I didn't add / change any roles, as i taught it was not necessary ( Since documentations didn't mention to do that for Customer access tokens, only for Integration token type)
    – MePo
    Feb 1, 2018 at 13:56
  • ahh didnt notice there is customers/me . My mistake, sorry. I will post answer Feb 1, 2018 at 14:05
  • What is your exact Magento 2 version?
    – PY Yick
    Feb 2, 2018 at 2:47
  • My version is 2.2.2
    – MePo
    Feb 2, 2018 at 6:24

3 Answers 3


I tried the below two options in different M2 versions:

  • After login in Customer Account, tried to access http://<hostname>/rest/V1/customers/me Rest API with session based access.
  • Using Customer token tried to access V1/customers/me Rest API using Advanced Rest Client

In Magento version 2.1.6 both above options worked fine.

In Magento version 2.2.2, I was getting Consumer is not authorized error in first option but able to get the customer info from second info.

  • 1
    I was able to get it working with new a installation. Really strange, didn't do nothing different than before with version 2.2.2.
    – MePo
    Feb 5, 2018 at 8:31
  • can you give me details on your server configuration (Php version, Database...). So i can compare to mine, i am wondering why it is working now (since i have no clue to why it is working now on version 2.2.2 )?
    – MePo
    Feb 5, 2018 at 13:21

I was having the same issue and finally found the solution here.

Turns out the issue was Postman - I had to delete the cookies that Postman automatically attaches to requests. Once I deleted all cookies for my site I was good to go.


the admin token is not required. The route rest/V1/customers/me can be used by a logged in user without a token to return information about that customer. Please try the following:

  • Go to storefront in browser
  • Create user account
  • Login to user account
  • Enter URL http://<hostname>/rest/V1/customers/me, replacing with the server you are using

This will return information about the logged in customer directly to your browser.
If you want to get information about any other customer, you will need to generate an admin token and use it with the route GET /V1/customers/{customerId}

Have You tried this: CLICK HERE ?
It should be helpful :)

  • I tried exactly this before and i was getting the same error in browser. So there must be an error somewhere else?
    – MePo
    Feb 1, 2018 at 14:11
  • I just edit my post Feb 1, 2018 at 15:09
  • I will be building an mobile app, so that is the reason i chose this way. I will try this too. Just to see if i can get the user info and not the error
    – MePo
    Feb 2, 2018 at 6:28
  • I solved this by "reinstalling" magento, fresh install and now it worked. The funny part is i didn't do anything different than the first time.
    – MePo
    Feb 5, 2018 at 13:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.