I tried to change the default customer access token expiration from 1 hour to 48 hours and even to 0 to disable expiration, but regardless of what number I enter, the token I receive from the REST API expires in 1 hour. I cleaned the cache, flushed it.

What can I do to make Magento use the numbers I enter? (Magento 2.4.4)

My current settings in Magento

This is how the API request looks like:

POST https://elszerbt.alphadev.hu/rest/default/V1/integration/customer/token
Accept: application/json
Content-Type: application/json

{"username": "[email protected]", "password": "mypassword"}

The customer has been added manually and the password setup through the activation email link. This test customer is the only one right now:

List of customers

The token works perfectly once it's received, but it expires early. You can see the token here:


If you enter this token to https://jwt.io/, you can see the difference between the issue date and expiration date is 1 hour.

I also tested the admin token the following way:

POST https://elszerbt.alphadev.hu/rest/default/V1/integration/admin/token
Accept: application/json
Content-Type: application/json

{"username": "adminuser", "password": "mypassword"}

What's interesting is that it also expires in 1 hour, which is not the default setting for admin tokens. The default is 4 hours.

This is the admin token I received:


I have this issue on multiple instances, although they have exactly the same setup. I'm using the default file-system cache of Magento.

  • 1
    are you able to add more info on how to reproduce your issue? How is the API call you make? header, body, endpoint will be useful to ensure we can replicate exactly your issue? Commented Aug 16, 2022 at 14:00
  • Hi, thanks, I added more information. Commented Aug 17, 2022 at 9:11

4 Answers 4


I found the solution. There is another setting here:

Other configuration page

I set the expiration here to 600 minutes and it works perfectly.


This might be a setting in your redis configuration.

please check your redis settings in your env.php.

documentation can be found here: https://experienceleague.adobe.com/docs/commerce-operations/configuration-guide/cache/redis/redis-pg-cache.html

  • Hi. Thanks, but I'm not using redis, the caching is set to default. Commented Aug 17, 2022 at 9:36
  • Any ideas how can I determine if it's a caching problem? Commented Aug 17, 2022 at 9:45

The setting for the Token expiration can be found in Store/Configuration/Services/OAuth

See screenshot below,

enter image description here

  • No, it's not. That's my exact point. It doesn't do anything. Commented Aug 18, 2022 at 12:21
  • I believe you must have a customisation taking over this behaviour in Magento as it seems fine at my end Commented Aug 18, 2022 at 12:25
module:disable Magento_JwtUserToken Magento_AdobeStockAdminUi Magento_AdminAdobeIms

That will make the token not reset.

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.