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}" }

  • please check with that customer account may be its disabled. – Anas Mansuri Sep 11 at 5:06
  • Then how can I enable it? – kuch bhi nhii Sep 11 at 5:07
  • goto admin and than check with customer – Anas Mansuri Sep 11 at 5:11
  • please explain the steps – kuch bhi nhii Sep 11 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. – Aditya Shah Sep 11 at 5:21
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
  • Actually,ii wanted to get an customer token..not admin token – kuch bhi nhii Sep 11 at 8:05
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, privacy policy and cookie policy

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