invalid_grant: undefined - [undefined]: AADB2C90085: The service has encountered an internal error. Please reauthenticate and try again

Paritosh Arya 0 Reputation points
2025-02-27T13:14:10.91+00:00

0

Getting invalid_grant: undefined - [undefined]: AADB2C90085: The service has encountered an internal error. Please reauthenticate and try again.

out of nowhere in DEV environment. It used to work fine but suddenly it started throwing this error. checked all the configurations and code. the same code works when PROD configurations are used but throws this error in token request endpoint with DEV configurations.

Compared the custom policies and policy keys.

How to troubleshoot further i dont understand...

This is generated token endpoint

https://<tenant>.b2clogin.com/<tenant>.onmicrosoft.com/b2c_1a_signup_signin/oauth2/v2.0/token
Payload
client_id: <clientid>
redirect_uri: https://www.test.site.se/
scope: https://tenant.onmicrosoft.com/<guid>/user_impersonation 
openid profile offline_access
code: 
code_verifier: 
grant_type: authorization_code
client_info: 1
client-request-id:

Api permission blade of front end app
User's image

log for this error from Audit logs
User's image

Please mention if anything else is needed to understand the question better

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
23,665 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. BANDELA Siri Chandana 1,800 Reputation points Microsoft External Staff
    2025-03-03T08:06:28.7+00:00

    Hi @Paritosh Arya
    Thank you for posting your query on Microsoft Q&A.

    It seems you are encountering error AADB2C90085: "The service has encountered an internal error. Please reauthenticate and try again".

    It works fine when you use PROD configurations but throws error in token request endpoint with DEV configurations.

    Kindly follow the link to troubleshoot the error: https://learn.microsoft.com/en-us/answers/questions/1350703/invalid-grant-error-while-trying-to-request-a-toke

    Hope this helps. Do let us know if you have any further queries.

    If this answers your query, do click `Accept Answer` and `Yes`.


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.