I have two proxies, sharing oauth tokens. A third proxy, generates token. Proxy-1 after verifying token, adds some token attributes using SetOAuthV2Info. Proxy-2 after verifying token - tries to access one of the attributes - but it is sometimes missing ( 2/8 times) I have explicitly tried using GetOAuthV2Info policy, but some attributes are still missing (2/8 times). I add 7 attributes, 4 are always availalbe, 3 are missing (2/8 times). On-Prem installation, 2 message processors, Can this inconsistency be explained ? Is there a workaround, forceful refresh on the token attributes ?
Solved! Go to Solution.
It's possible that the Token cache is causing the behavior you are observing.
Try this test: after adding attributes, wait 3 minutes, and only THEN try the next request.
Do you see all the attributes?
Today there is no way to "force refresh" of token attributes.
If you need to dynamically map tokens to different attributes, I suggest you use an explicit database or datastore in which you can control the caching. For example, use the Apigee Edge Cache. You might set the TTL on the attributes list to have an expiry just after the token expiry.
Or, use BaaS. In that case you will need to clean up token entries in the BaaS after the tokens expire.
Helpful?