How to update Access Token Lifetime

Hi,

How can I update the lifetime of the access token?
I have a Native app and I dont see any option there.
IU went through the link https://auth0.com/docs/tokens/access-tokens/update-access-token-lifetime before posting the question here.
I see option to update id token lifetime but not access token.

Hi @kiran.ms

The access token lifetime is not in the application itself, but in the API that you’re using as the audience in your authentication request. As an example, if you were triggering the authentication request with:

Auth0
    .webAuth()
    .audience("https://yourdomain.com/api")
    .start { result in
        switch result {
        case .success(let credentials):
            print("Obtained credentials: \(credentials)")
        case .failure(let error):
            print("Failed with \(error)")
        }
    }

You’d have a custom API with identifier https://yourdomain.com/api registered in the API section of the Auth0 dashboard, where you could specify the access token lifetime in the Token Expiration field.

Token Expiration (Seconds) : The amount of time (in seconds) before the Auth0 Access Token expires. The default value is 86400 seconds (24 hours). The maximum value you can set is 2592000 seconds (30 days).

2 Likes

Thanks @ricardo.batista . It worked.

1 Like

We are here for you!

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.