B2C Error while user sign in

Vikas Tiwari 771 Reputation points
2020-08-13T04:43:08.787+00:00

Hi @AmanpreetSingh-MSFT ,

I am trying seamless user migration to B2C through custom policy, following is policy details that I am running:

 <RelyingParty>  
    <DefaultUserJourney ReferenceId="SignUpOrSignInWithUsername" />  
	<UserJourneyBehaviors>  
		<JourneyInsights TelemetryEngine="ApplicationInsights" InstrumentationKey="app-insight-instrumentation-key" DeveloperMode="true" ClientEnabled="false" ServerEnabled="true" TelemetryVersion="1.0.0" />  
	</UserJourneyBehaviors>  
    <TechnicalProfile Id="PolicyProfile">  
      <DisplayName>PolicyProfile</DisplayName>  
      <Protocol Name="OpenIdConnect" />  
      <OutputClaims>  
        <OutputClaim ClaimTypeReferenceId="displayName" />  
        <OutputClaim ClaimTypeReferenceId="givenName" />  
        <OutputClaim ClaimTypeReferenceId="surname" />  
        <OutputClaim ClaimTypeReferenceId="email" />  
        <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>  
        <OutputClaim ClaimTypeReferenceId="signinname" />  
      </OutputClaims>  
      <SubjectNamingInfo ClaimType="sub" />  
    </TechnicalProfile>  
  </RelyingParty>  
</TrustFrameworkPolicy>  

While running this policy and sign in through username and password, I am getting following error :

"The metadata endpoint 'https://login.microsoftonline.com/{tenant}/.well-known/openid-configuration' returned the following status code: '400'"

I am not understanding failure reason, I have tried to get details in application insight but it didn't have any details.

Could you please help me to understand where its going wrong or how can I get details error description and possible failure reason?

Thanks for your help.

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,917 questions
0 comments No comments
{count} votes

Accepted answer
  1. AmanpreetSingh-MSFT 56,646 Reputation points
    2020-08-13T16:18:59.887+00:00

    Hello @Vikas Tiwari

    Since you are facing this issue during sign in, the technical profile you need to look at is login-NonInteractive (in TrustFrameworkBase.xml by default) where we have Metadata item key with OIDC metadata url as highlighted below:

    17531-untitled.png

    The {tenant} parameter in the URL should be translated to your B2C tenant name and looking at the error it is being passed as {tenant} only. In my case it is getting translated to my tenant name and I am able to sign-in with username successfully.

    Just to confirm that {tenant} is being translated to my tenant name, I updated the OIDC metadata url to https://wrong-login.microsoftonline.com/{tenant}/.well-known/openid-configuration (with wrong- at the beginning of the URL) and I can see my tenant name in the error:

    17534-image.png

    To replicate your error, I just updated {tenant} to {tenant2} and encountered the exact same error that you are getting:

    17458-image.png

    The {tenant} to actual tenant name translation should happen automatically. If it is not happening, you can explicitly specify your tenant name in the OIDC metadata url as mentioned below:

    https://login.microsoftonline.com/yourB2cTenant.onmicrosoft.com/.well-known/openid-configuration

    -----------------------------------------------------------------------------------------------------------

    Please "Accept the answer" if the information helped you. This will help us and others in the community as well.


0 additional answers

Sort by: Most helpful

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.