Hi Community,
We are on ISAM 9.0.5
We have OAuth for a mobile app.
I am trying to understand why some of the refresh_token received in Production are being rejected (approx. 1% of refresh token are rejected).
With trace in the pre-mapping rules, it seem that these rejected token are simply not in the database:
I get the token:
stsuu.getContextAttributes().getAttributeValuesByNameAndType("refresh_token", "urn:ibm:names:ITFIM:oauth:body:param");
when I try to obtain the corresponding token objet:
var token = OAuthMappingExtUtils.getToken(refresh_token);
the token var is NULL
So in the AAC's Advanced Configuration, I have set:
oauth20.tokenCache.cleanupWait= 604800
(one Week)
In the pre-token mapping rules, I set:
var max_oauth_grants_per_user_per_client = 30;
var limit_method = "lru";
I was expecting that the resulting behavior would be that the tokens get accumulated in the runtime database for up to a week.
I was expecting the stale token (either expired bearer or already used/expired refresh) would stay in the database with flag TOKEN_ENABLE at "N".
Having those "old" disabled token could have given me a clue as to what is happening: I could look at the created date & the last used date to try & rebuild the sequence of events that lead to the refresh token being refused.
But it seems that the stale tokens get erased from the database every time I go through a refresh_token process. Is there a way to avoid this?
Also, can you suggest which trace could be activated that would help me understand what is happening?
We had an issue with the app (in some very specific cases) trying to refresh multiple time using the same refresh token. I activated "Enable multiple refresh tokens for fault tolerance". That fixed this issue and reduced the rejected numbers but we still have a approx. 1% rejection. And the refresh token cannot really be expired as the app has not been in production longer that the life of the refresh_token. We've been in prod for 3 months & the refresh_token have a lifetime of 6 months.
Many thanks,
Louis
------------------------------
Louis Beaudry
Access Management
Intact Financial Corporation
------------------------------