Ready to post? First, try searching for your answer.
When I obtain a new access_token using the Client Credentials flow, the expiry time is always set to one hour. (3600 seconds). Ideally, I would want these tokens to be valid for longer.
I see docs that mention you can change Token Expiration (Seconds) and Token Expiration For Browser Flows (Seconds) in API settings, however, the settings page for my API only shows Maximum Access Token Lifetime, and Implicit/Hybrid Flow Access Token Lifetime.
My maximum lifetime is set to 86400 seconds, and implicit/hybrid is set to 7200 seconds.
Why are my JWTs only valid for one hour? Where is the 3600 value set? How can I change it to 24 hours?
I believe the Token Expiration setting you are talking about is the one available through the M2M application created in your Auth0 Dashboard. The token expiration time of 3600 are set by default for applications which appears to override the tokens provided by the API.
If you go to your M2M application’s setting you should see the following:
I don’t understand why the lifetime of the ID token would affect the lifetime of the access token, but that being said, I can see that the value in my application settings is in-fact set to 36000 seconds (10 hours), but the exp value token in my access_token is 3600 seconds. (1 hour).
Here is a screenshot from the .Net debugger that shows the value I am receiving from Auth0.
Sorry, I must have misread something in your post and made myself believe you were referring to the ID Token, It has been a long day!
Thanks for providing me the screenshot, I will investigate some more regarding the matter. Do you mind sharing via a DM the tenant name on which you have this issue on so I can take a look around?
As you have confirmed that making the cURL request and also another call returned from your PostMan application, the token expiration returned matched the one set via the Auth0 Dashboard.
I have identified an action where you set a token inside the cache which could affect the value returned by your application however that is unlikely.
As you have stated, the issue might reside inside a library used in your application called IdentityModel.Client which might modify or replace the actual lifetime set by the dashboard. I will be posting the screenshot you have shared with me for reference so that anybody else can take a look at it:
( if you want to have this screenshot removed, let me know! )
Whenever you identify the issue within the application which would modify the lifetime of the token, feel free to share it with the rest of the community!
Otherwise, if you have any other questions, just leave a reply or post again on the community referencing to this post!