Issue: AADSTS165000 when using domain_hint=Google and login_hint for direct Google login in Entra External ID

Saravana Kumar Palanisamy 30 Reputation points
2025-12-06T12:39:23.25+00:00

I have configured Microsoft Entra External ID with Google authentication and local accounts. The default sign-in page shows the Google button, but I want users to go directly to Google login without clicking it to achieve the Google OneTap login


✔️ What I Did

I added the following parameters to the authorization request so the user is redirected straight to Google:

domain_hint=Google

login_hint=******@gmail.com

prompt=login

This works for first-time sign-in:

User goes straight to Google

Authenticates successfully

Returned to the “Add details” page (External ID sign-up)

User completes details

Auth code is sent to the application

Login completes successfully


❌ The Problem

When I try to log in again using:

domain_hint=Google&login_hint=******@gmail.com&prompt=login

I get this error:

Request Id: aaaaaaaaaaa
Correlation Id: aaaaaaaaaa
Timestamp: 2025-12-06T12:28:14Z
Message: AADSTS165000: Invalid Request: The request did not include the required tokens for the user context. One or more of the user context values (cookies; form fields; headers) were not supplied, every request must include these values and maintain them across a complete single user flow. The request did not return all of the form fields. Failure Reasons:[Token was not provided;]

🔍 Additional Finding

If I remove the login_hint parameter, it works successfully. So the issue appears only when both domain_hint=Google and login_hint are used together on subsequent sign-ins.


❓ What I Need Help With

After completing sign-up, the next login attempt fails with AADSTS165000 when using both domain_hint and login_hint.

It seems the External ID user flow expects certain context cookies / tokens, and using login_hint may cause the flow to skip part of the expected sequence, resulting in missing form tokens.

Has anyone successfully implemented direct Google login with External ID using login_hint? Any help or guidance would be greatly appreciated!

Microsoft Security | Microsoft Entra | Microsoft Entra External ID

1 answer

Sort by: Newest
  1. AI answer

    2025-12-06T12:39:37.43+00:00

    The error AADSTS165000 indicates that the request is missing required tokens for the user context. This often occurs when the authentication flow does not maintain the necessary session state across requests. When using both domain_hint=Google and login_hint, it seems that the flow may be skipping some steps that are required to maintain the session context, particularly after the initial sign-up.

    Here are a few suggestions to troubleshoot and potentially resolve the issue:

    1. Check Session State: Ensure that the session cookies are being maintained properly between requests. If the session is lost, the login_hint may not be able to retrieve the necessary context.
    2. Use login_hint Carefully: Since you mentioned that removing login_hint allows the login to succeed, consider using it only when necessary. For subsequent logins, you might want to rely on the session state rather than explicitly passing login_hint.
    3. Review User Flow Configuration: Double-check the configuration of your user flow in Microsoft Entra External ID to ensure that all required parameters are set correctly and that the flow is designed to handle the direct login scenario.
    4. Testing with Different Scenarios: Try testing the login process with different user accounts or configurations to see if the issue persists across all scenarios or is isolated to specific accounts.
    5. Consult Documentation: Review the Microsoft documentation regarding the use of domain_hint and login_hint to ensure that you are following best practices and that there are no additional requirements for your specific setup.

    If the issue continues, consider reaching out to Microsoft support for more tailored assistance regarding the Entra External ID and Google authentication integration.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

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