Azure AD B2C Token refresh is not working for Entra ID Identity provider.

Rinesh PK 20 Reputation points
2024-02-10T05:30:47.41+00:00

I am in the process of configuring Azure Active Directory B2C to utilize Microsoft Entra ID as an identity provider. To achieve this, I have set up the identity provider using a custom policy, implementing the authorization code flow as per the documentation available here. The current configuration allows me to successfully obtain an access token and refresh token in the response, and the authentication process is functioning correctly. However, upon the expiration of the access token, the refresh token call fails, resulting in a 400 Bad Request error with the following details.

 "error": "invalid_grant",
    "error_description": "AADB2C90128: The account associated with this grant no longer exists. Please reauthenticate and try again.

I'm seeking guidance as I'm unable to determine the cause behind the failure of the refresh token call. Can someone point me in the right direction to troubleshoot and resolve this issue?

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} votes

1 answer

Sort by: Most helpful
  1. JamesTran-MSFT 36,911 Reputation points Microsoft Employee Moderator
    2024-02-12T22:20:01.5266667+00:00

    @Rinesh PK

    Thank you for your post and I apologize for the delayed response!

    Error Message:

    AADB2C90128: The account associated with this grant no longer exists. Please reauthenticate and try again.

    Based off your error message, it looks like the account associated with the grant no longer exists and to hopefully help point you in the right direction, I'll share some troubleshooting steps below.

    1. Can you check to make sure that the user account still exists within Microsoft Entra ID (the identity provider).
    2. Can you also make sure that the refresh token hasn't expired? Refresh tokens have a limited lifetime, and if the token has expired, you will need to obtain a new refresh token.

    If the user is still present and the refresh token hasn't expired, can you see if your Azure AD B2C audit logs contain any more info that might help troubleshoot your issue?

    Additional Links:

    I hope this helps!

    If you have any other questions, please let me know. Thank you for your time and patience throughout this issue.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.