the problem seems to be at the level of the token refresh. When I connect an account, he work between 1 hour and 1h30, but when it expires, I’m forced to delete token in Token Cache List, and re-authorize connection on Email Account.
I have tried to execute the comportement of TokenCache.update_data in a console. So, in database, the token appears to be updated correctly, but the error persists.
I’m so puzzled. I have the same configuration in Azure in production, the same versions of frappe and ERPNext, and it work’s. The only one difference, in development, ERPNext is build with custom image of frappe, to customize EmailAccount.pull, but no modification on token management.
I don’t know if you can access the userinfo endpoint like that or it should have azure tenent id in the url.
Basically we need to check: if the token is valid or not before and after the update. And the data is stored correctly on frappe side. If something is missing (incorrect data, invalid token) it will cause 403.
So, since recovering a token from the refresh token of the non-functional token, deleting the old token, then creating a new one with the information from the generated token works, I am quite confident about the information carried by the token and suspicious about token_cache.update_data or internal usage of token after update.
I have good value for accessTokenAcceptedVersion in the Manifest of my application.
I have found other similar thread, who talk about scopes, and I have tried to delete all scope, and token is already in v1.
I’m very confused. I have verifying many many time configuration in Prod where he work, also with token v1, vs dev where is down. Only ID’s are differents …