Set Custom Token Expiry in Apigee X

We have requirement to set custom token expiry for a specific App on Developer Portal. How to achieve it? @dchiesa1 

0 4 120
4 REPLIES 4

The expiration default value of app credential cannot be changed. Expiration settings must be passed when creating a new app and unfortunately this is not available in the Integrated Developer Portal. We are tracking this feature request already (internal ref b/128330801). One workaround is you could reissue a credential with a custom expiration to the SAME app and this will be displayed in the Developer Portal. 

This could easily be implemented (via custom code) if you're using the Drupal Developer Portal. 

We are able to set an Expiry Variable and can see the value in the Trace

sanugu_0-1675970589976.png

Want to use that variable for <ExpiresIn>. We are using below syntax to set custom expiry in the OauthV2 policy, but token is not returned with custom expiry value. Can you please let us know if it is right syntax?

sanugu_1-1675970686368.png

@apickelsimer @dchiesa1 

 

Ah, I see. I misunderstood your question. My previous reply is related to custom expiration of App credentials, specifically client_id and client_secret.

You're asking about custom expiration of OAuth tokens. This is described in the docs. It doesn't appear the syntax you are using is incorrect. The syntax is as follows:

<ExpiresIn ref="kvm.oauth.expires_in">
    3600000 <!--default value in milliseconds-->
</ExpiresIn>

Pls upload a trace session of this request to this post and I can look to see what's happening.

<ExpiresIn ref="kvm.oauth.expires_in">
3600000 <!--default value in milliseconds-->
</ExpiresIn>

Above example does not seem to work. I cannot share the trace because of the ID's being shared which are confidential.

@apickelsimer