1

I have setup an auth provider with Open Id Connect.

It works well but I have an issue when I want to refresh the token.

I'm using this line to get a token.

Auth.AuthToken.getAccessTokenMap(auId, 'Open ID Connect'); 

then

Auth.AuthToken.refreshAccessToken(auId, 'Open ID Connect', authToken);

with authToken being actually the access_token.

The last line of code is returning

invalid_grant unknown, invalid, or expired refresh token

but only if authToken has expired, if it's still within it's lifespan the refresh actually works.

The thing is I don't know when the user will need a token(mostly used to call an external system) so I can't make something like "ok lets refresh a few minutes before the actual token gonna expire".

Also I can't understand why the standard class Auth.AuthToken can't/don't return an actual refresh_token value but just an access_token actually.

Anyone? Thank you

4
  • 1
    Does this answer your question? How to refresh a token retrieved from the Auth.AuthToken class
    – identigral
    Commented Apr 3 at 17:28
  • Thank you @identigral ! it looks like this is the same issue, however I can't figure out how it has been solved though.
    – AshBringer
    Commented Apr 3 at 21:56
  • The accepted answer is how it was solved
    – identigral
    Commented Apr 3 at 22:14
  • So if I add the scope offline_access to the auth provider, the refreshAccessToken method might return a refresh token ? that will be surprising..
    – AshBringer
    Commented Apr 3 at 22:23

0

You must log in to answer this question.