Announcements
This site is in read only until July 22 as we migrate to a new platform; refer to this community post for more details.
Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How to manage session/state for a caller in edge microgateway

hi,

We are running on 5.12 microgateway and have a use case as below:

A requester sends a request to MGW, it calls for an Auth server and fetches the oauth token which we are caching it. And using the token we are sending the request to the Target API.

The cache will live till the token's expiry in microgateway and the requests lookup the cache everytime before proceeding to Target API.

If incase the token is revoked while its still living in microgateway cache, the request to target server would fail with 401 http code.

We are trying to handle this 401 thrown from target server.

When it throws a 401, we want to fetch the token from Auth server again (this is achieved) and then send the request to target API again.

How do we maintain the initial request details when we are sending the request again after we receive a 401 at first.

FYI: We are trying to handle this error in 'ondata_response' event

Thanks

0 5 301
5 REPLIES 5