I am creating the acess token using API /rest/default/V1/integration/customer/token.

The Api is returning Access token successfully but it didnot saved in database in oauth_token table. also it is returning such an oversized token like the example below

Token : eyJraWQiOiIxIiwiYWxnIjoiSFMyNTYifQ.eyJ1aWQiOjEsInV0eXBpZCI6MywiaWF0IjoxNjYzMTQwOTEwLCJleHAiOjE2NjMxNDQ1MTB9.cVAmjkNjt1n0Mw5fFPu80RluHoRbX48oq9cBqal6hxo

I am performing the same thing in Magento 2.4.2 it is working fine

Any information / help regarding this. Thanks in advance

3 Answers 3


To login into the Magento system and get the access token to make API calls.

Production Endpoint: /rest/default/V1/integration/admin/token

Request Type: POST Headers: Content-Type: application/json

Payload: { "username": "magento", "password": "magento123" }

Success Response: "B391nln5pzg64ru7jt51xz5tjfcojftj"

  • This is working fine on Magento 2.4.2 or previous versions and data aslo get saved in the database, but in magento 2.4.3 or later versions the data is not getting saved in oauth_token table , @Maham Please read the question carefully Sep 14, 2022 at 7:43

I will be glad if I can help you

Before creating an access token in Magento 2.4.5, configure your account with the appropriate permissions for what users can access when using their tokens. Before generating any tokens for use on your site, go into your store configuration settings and set up roles with benefits. Once this is done you can generate a new API key from within the admin panel which will serve as both a public identifier and private secret associated with each customer's account information stored on file at Magento's servers.

Once these steps are completed, customers who wish to use their unique API keys must register themselves through either third-party services or directly through Magento itself depending upon which method has been chosen by administrators beforehand; once registered they may proceed to obtain their personalized Access Token via various methods provided by developers such as OAuth 2 protocol implementations etcetera. After completing all necessary steps required, customers should now possess valid Access Tokens that allow them full usage rights over whatever resources were permitted during the initial setup stages earlier mentioned herein above!

If you have any questions, you can contact us on the website - IdeaInYou


Magento 2.4.5 does not save the token to the database because there is no more need to do so. All information is contained in the token itself. (Before the token was just used as a key in the database where the relevant information was put.)

See also my answer on how to read the token. How to get user id from JWT authentication Token in Magento 2.4.5

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.