1

When I try to load /rest/v1/integration/customer/token, passing username and password in the body, it shows below error:

{ "message": "You did not sign in correctly or your account is temporarily disabled.", "trace": "#0 [internal function]: Magento\Integration\Model\CustomerTokenService->createCustomerAccessToken('mallika.sarna@h...', 'bWFsbGlrYS5zYXJ...')\n#1 /Applications/MAMP/htdocs/magentoshop/vendor/magento/module-webapi/Controller/Rest.php(330): call_user_func_array(Array, Array)\n#2 /Applications/MAMP/htdocs/magentoshop/vendor/magento/module-webapi/Controller/Rest.php(239): Magento\Webapi\Controller\Rest->processApiRequest()\n#3 /Applications/MAMP/htdocs/magentoshop/vendor/magento/framework/Interception/Interceptor.php(58): Magento\Webapi\Controller\Rest->dispatch(Object(Magento\Framework\App\Request\Http))\n#4 /Applications/MAMP/htdocs/magentoshop/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Webapi\Controller\Rest\Interceptor->___callParent('dispatch', Array)\n#5 /Applications/MAMP/htdocs/magentoshop/vendor/magento/framework/Interception/Interceptor.php(153): Magento\Webapi\Controller\Rest\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))\n#6 /Applications/MAMP/htdocs/magentoshop/generated/code/Magento/Webapi/Controller/Rest/Interceptor.php(39): Magento\Webapi\Controller\Rest\Interceptor->___callPlugins('dispatch', Array, Array)\n#7 /Applications/MAMP/htdocs/magentoshop/vendor/magento/framework/App/Http.php(135): Magento\Webapi\Controller\Rest\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))\n#8 /Applications/MAMP/htdocs/magentoshop/generated/code/Magento/Framework/App/Http/Interceptor.php(24): Magento\Framework\App\Http->launch()\n#9 /Applications/MAMP/htdocs/magentoshop/vendor/magento/framework/App/Bootstrap.php(256): Magento\Framework\App\Http\Interceptor->launch()\n#10 /Applications/MAMP/htdocs/magentoshop/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http\Interceptor))\n#11 {main}" }

6
  • please check with that customer account may be its disabled. Sep 11, 2019 at 5:06
  • Then how can I enable it? Sep 11, 2019 at 5:07
  • goto admin and than check with customer Sep 11, 2019 at 5:11
  • please explain the steps Sep 11, 2019 at 5:16
  • 1
    Mr. Lord - Just run setup upgrade and clear the cache sometimes that happens, I was stuck in the same situation once. Sep 11, 2019 at 5:21

3 Answers 3

0

First you will want to post to retrieve a token. You will need to post an admin username and login.

POST https://somewebsite.com/rest/all/V1/integration/admin/token
Content-Type: application/json

{
  "username": "admin",
  "password": "Password123"
}

The response will provide a valid bearer token. Use this token to begin making the API requests:

GET https://somewebsite.com/rest/all/V1/orders/12345
Content-Type: application/json
Authorization: Bearer uxn42pnqksxh1mnwarj0pqprtwyg3hfn
1
  • Actually,ii wanted to get an customer token..not admin token Sep 11, 2019 at 8:05
1

It's on old question but still it might be helpful since I got same kind of issues. It turns out Magento keeps track of failed login attempt trough API. And for me this was hard to solve/find. That's why I am posting it here.

So check the oauth_token_request_log table for entries. So in development phase this can occur very fast of course. The credit goes to Muhsin Keloth form this post. https://stackoverflow.com/a/41959142/2190322

tl;dr

DELETE FROM oauth_token_request_log;

0

To get a customer token,

POST https://somewebsite.com/rest/V1/integration/customer/token

Content-Type: application/json

{
  "username": "username",
  "password": "Password123"
}

You can test with curl:

curl https://somewebsite.com/rest/V1/integration/customer/token \
-H 'Content-Type: application/json' \
-d '{"username":"username","password":"password"}'

If under Windows, you will need to use double quote and escape double quotes in data correctly:

curl https://somewebsite.com/rest/V1/integration/customer/token \
-H "Content-Type: application/json" \
-d "{\"username\":\"username\",\"password\":\"password\"}"

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.