Can not sign into external tenant. Get error: "IDX20804: Unable to retrieve document from ___v2.0/.well-known/openid-configuration"

David Potter 0 Reputation points
2024-06-04T20:28:54.03+00:00

I am unable to get external Id tenant to sign in for my .net 8 Blazor (Server) application. I have followed these steps to create the user flow and integrate it into my application.
https://learn.microsoft.com/en-us/entra/external-id/customers/tutorial-web-app-dotnet-sign-in-prepare-tenant

When I click the Sign in button (which resolves to "https://localhost:7234/MicrosoftIdentity/Account/SignIn"), nothing happens for 60 seconds then this timeout error is shown

"IDX20804: Unable to retrieve document from: 'https://----------.ciamlogin.com/------------.onmicrosoft.com/v2.0/.well-known/openid-configuration'., InnerException: The request was canceled due to the configured HttpClient.Timeout of 60 seconds elapsing.."

I am able to browse to "https://----------.ciamlogin.com/------------.onmicrosoft.com/v2.0/.well-known/openid-configuration" without any issue and get the json object back. My appsetting.json follows the code example exactly.

"AzureAd": {
  "Authority": "https://------------.ciamlogin.com/",
  "ClientId": "------------------------",
  "ClientCredentials": [
    {
      "SourceType": "ClientSecret",
      "ClientSecret": "---------------------"
    }
  ],
  "CallbackPath": "/signin-oidc",
  "SignedOutCallbackPath": "/signout-callback-oidc"
}

I am able to test the user flow by doing "Run user flow endpoint" and am able to see the login page for my external tenant.

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,760 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 29,531 Reputation points Microsoft Employee
    2024-06-10T06:48:49.03+00:00

    Hi @David Potter ,

    Thanks for reaching out.

    I setup the lab based on above mentioned document step by step as mentioned in the document and able to signup/ sign in successfully using ASP.net core.

    User's image

    You have mentioned that you are trying to sign in using "https://localhost:7234/MicrosoftIdentity/Account/SignIn".

    Could you please cross check the redirect URL you configured in your application. As per document the port is 7274 in https://localhost:7274/signin-oidc.

    Could you please check launch.settings, redirect URL and appsettings.json all are configured with same URL.

    If you are still not able to resolve the issue, please let me know so we can connect offline to check this further.

    Hope this will help.

    Thanks,

    Shweta

    Please remember to "Accept Answer" if answer helped you.

    0 comments No comments