Hi YasithaPandithawatta-2282,
Thanks for reaching out.
From your query I understand that you are facing issue to get the access token due to invalid refresh token.
There might be possible scenarios in this case.
- This error is due to when refresh token can be expired due to either if the password changed for the user or the token has been revoked either by user or admin through PowerShell or Azure portal. As you have already confirmed the above possibilities, there might be chance that Conditional Access policy has been configured to control user
Refresh token and force user to sign-in again. - Another possibility is that you are not replacing the old refresh token with a fresh one, which is also provided whenever you make a call to get a new
access token using a refresh token.
As mentioned in Refreshing the access token , Refresh tokens aren't revoked when used to acquire new access tokens. You're expected to discard the old refresh token. When you receive a response with a refresh token error, discard the current refresh token and request a new authorization code or access token. In particular, when using a refresh token in the Authorization Code Grant flow, if you receive a response with the interaction_required or invalid_grant error codes, discard the refresh token and request a new authorization code.
Hope this will help.
Thanks,
Shweta
------------------------------------
Please remember to "Accept Answer" if answer helped you.