You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If I have a context configuration that holds an access_token and/or refresh_token and that it gets invalidate outside of this context, then on the next getToken, as long as the token is not expired it will be returned although it's invalid.
This applies for both action and cli config
Reproduce
const{ Ims, getToken, invalidateToken, context }=require('.')constconfig={client_id: "<jwt-clientid>",client_secret: "XXX",techacct: "<guid>@techacct.adobe.com",meta_scopes: ["ent_dataservices_sdk"],ims_org_id: "<org-guid>@AdobeOrg",private_key: "XXX"}awaitcontext.set('my-ctx',config)consttoken=awaitgetToken('my-ctx')// await invalidateToken('my-ctx') => would delete the token in the config// but if the token is invalidate elsewhere the token would still be in the config// exampleconstims=newIms('prod')awaitims.invalidateToken(token,config.clientId,config.clientSecret)consttoken2=awaitgetToken('my-ctx')// would return the same cached token which is invalid// furthermore now a call to invalidateToken will throw an error as the token is not valid
Possible solution
in every getTokenIfValid call in token-helper.js validate the token against IMS, however this will trigger many more requests and reduces the advantage of caching the token
The text was updated successfully, but these errors were encountered:
Describe the bug
If I have a context configuration that holds an
access_token
and/orrefresh_token
and that it gets invalidate outside of this context, then on the next getToken, as long as the token is not expired it will be returned although it's invalid.This applies for both action and cli config
Reproduce
Possible solution
in every
getTokenIfValid
call intoken-helper.js
validate the token against IMS, however this will trigger many more requests and reduces the advantage of caching the tokenThe text was updated successfully, but these errors were encountered: