Is there a way to update expiry time of an existing access token ?

Not applicable

There is a use case where in based on certain condition I need the access token to be alive for 'x' more minutes than its expiry time.Is there a way to do that ?

Solved Solved
0 3 3,366
1 ACCEPTED SOLUTION

akoo
New Member

Seems like you should be able to use SetOauthv2Info policy for something like TTL, but you can't.

Another alternative that is not elegant, but should get the job done:

1) Track the access token where you want to change the TTL (e.g., save it to a variable).

2) Invalidate the token.

<OAuthV2 name="InvalidateToken">   
      <Operation>InvalidateToken</Operation>
      <Tokens>
	<Token type="accesstoken" cascade="true">flow.variable</Token>
	<Token type="refreshtoken" cascade="true">flow.variable</Token>
    </Tokens>
</OAuthV2>

3) Recreate the token using ExternalAccessToken policy with reference to the variable you saved in step 1. More info here.

View solution in original post

3 REPLIES 3

Not applicable

akoo
New Member

Seems like you should be able to use SetOauthv2Info policy for something like TTL, but you can't.

Another alternative that is not elegant, but should get the job done:

1) Track the access token where you want to change the TTL (e.g., save it to a variable).

2) Invalidate the token.

<OAuthV2 name="InvalidateToken">   
      <Operation>InvalidateToken</Operation>
      <Tokens>
	<Token type="accesstoken" cascade="true">flow.variable</Token>
	<Token type="refreshtoken" cascade="true">flow.variable</Token>
    </Tokens>
</OAuthV2>

3) Recreate the token using ExternalAccessToken policy with reference to the variable you saved in step 1. More info here.

Also, there's more on using ExternalAccessToken here: http://apigee.com/docs/api-services/content/use-third-party-oauth-system