Skip to content

problem rest authentication #1800

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Antonioele opened this issue Sep 5, 2015 · 4 comments
Closed

problem rest authentication #1800

Antonioele opened this issue Sep 5, 2015 · 4 comments

Comments

@Antonioele
Copy link

I request token for an admin user
curl -X POST "http://localhost/magento21/index.php/rest/V1/integration/admin/token" \

 -H "Content-Type:application/json" \
 -d '{"username":"admin", "password":"antonioxxx"}'

Magento respond:
"hlvqig3je87vfg9w3s3cjpqegewxc6e0"
I would view the customers :
curl -X GET "http://localhost/magento21/index.php/rest/V1/customers/me" \ -H "Authorization: Bearer hlvqig3je87vfg9w3s3cjpqegewxc6e0"
answer:
{"message":"Consumer is not authorized to access %resources","parameters":{"resources":"self"}}
Why I have token admin???????????????

@kandy
Copy link
Contributor

kandy commented Sep 5, 2015

Looks like you use admin account to request customer resource.
Use /V1/integration/customer/token to login as customer or use /customers/ endpoint with admin rights.

@Antonioele
Copy link
Author

@kandy Credential admin to login for request rest consumer return same message
{"message":"Consumer is not authorized to access %resources","parameters":{"resources":"self"}}
Perhaps hte problem is:I not use the protocol https but http

@Antonioele
Copy link
Author

@kandy thanks the role of admin not set now works

@vaimeo
Copy link

vaimeo commented Oct 13, 2016

i have problem my user is admin its working fine on Magento admin but not working when i request for token You did not sign in correctly or your account is temporarily disabled.

okorshenko pushed a commit that referenced this issue Dec 1, 2017
Public Pull Requests

#12516 Case mismatch by @lfluvisotto
#12513 Duplicate array key by @lfluvisotto
#12499 Format generated config files using the short array syntax by @cykirsch

Fixed Public Issues

#758 Coding standards: arrays
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants