Is it apigee private edge 4.19.01 support to store in cache for external JWT Token from response?

Hi, I am trying store jwt token in cache from external vendor JWT token and send stored cache JWT token to subsequent call until token expire?

here is the scenario.

1. Users call JWT Token generation to Apigee and apigee validate then send JWT Token to user

2. Users send Apigee JWT Token to their API call to Apigee and Apigee validate JWT Token then send same jwt token to backend API server

3. Backend server processed their request and send their JWT Token, Apigee jwt token in their response

4. Apigee needs to store in cache backend response JWT Token as apigee jwt token as key and remove JWT token from response and send response to users.

5. now all subsequent calls related with same API request comes from users with Apigee JWT Token and Apigee validate apigee generated jwt token then read backend provided jwt Token from cache and send JWT tokens to backend system.

I would like to know is it 2 jwt tokens supported by apigee edge private cloud 4.19.01 version

Solved Solved
0 2 273
1 ACCEPTED SOLUTION

Yes I think so. I'm not clear on exactly what you're doing, but it all sounds pretty reasonable.

The Apigee cache can store serializable things. It does not matter if the thing is a JWT.

The Apigee cache won't automatically and implicitly use the expiry on the JWT for the expire of the cache entry that holds a JWT. You will have to do a little work to determine the expiry of the JWT, and use that as the Expiry for the cached item. You can do that using VerifyJWT and then extracting the time_remaining variable, and using THAT for the ExpiresInSeconds value in PopulateCache.

View solution in original post

2 REPLIES 2

Yes I think so. I'm not clear on exactly what you're doing, but it all sounds pretty reasonable.

The Apigee cache can store serializable things. It does not matter if the thing is a JWT.

The Apigee cache won't automatically and implicitly use the expiry on the JWT for the expire of the cache entry that holds a JWT. You will have to do a little work to determine the expiry of the JWT, and use that as the Expiry for the cached item. You can do that using VerifyJWT and then extracting the time_remaining variable, and using THAT for the ExpiresInSeconds value in PopulateCache.

Thank you Dino for you response. I will try and get back to you incase any other question i have.