Possible to shorten the Oauth2 token?

We are generating access token using oauth2. I am getting a lengthy token. Please note that we are also using some attributes while generating the token. Is there a way we can configure apigee to get a short token.

 

@dchiesa1 @sidd-harth 

0 3 401
3 REPLIES 3

Can you elaborate on what is "lengthy" and what you intend by "short"?

Apigee (X and hybrid) issue opaque OAuth tokens of length ~28 characters, as far as I know. This length isn't documented, and it may change in the future, or for any particular Apigee organization, but I believe it's the common configuration for most organizations. Is that what you consider "lengthy"?


@arunprasath25 wrote:

We are generating access token using oauth2.


If you are using the OAuthV2 policy in Apigee, and the GenerateAccessToken operation, I would expect the token to have a length of 28. If you are using the OAuthV2 policy and the GenerateJWTAccessToken operation, then the token will be longer. That is unavoidable, since the token will be a JWT, which encodes all claims/attributes. To avoid that, don't use a JWT token! Use an opaque form.

Ours is opdk. 28 characters applies for opdk as well?

No.  I don't know what the length value for OPDK is.  But I believe it is a value of between 28 and 48. You should be able to observe this yourself.