0

First time working with B2C policies. Trying to upload the starter claims package for Local. All of the files give me the same error: Validation failed: 1 validation error(s) found in policy "B2C_1A_PASSWORDRESET" of tenant "mineb2c.onmicrosoft.com".TenantId in the policy xml 'yourtenant.onmicrosoft.com' is not same as the one in login tenant 'mineb2c.onmicrosoft.com'.TenantId in the policy xml 'yourtenant.onmicrosoft.com' is not same as the one in login tenant 'mineb2c.onmicrosoft.com'.

Where is yourtenant.onmicrosoft.com? Why am I getting this error?

Here is one of the smaller ones claims file.:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<TrustFrameworkPolicy
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  xmlns="http://schemas.microsoft.com/online/cpim/schemas/2013/06"
  PolicySchemaVersion="0.3.0.0"
  TenantId="mineb2c.onmicrosoft.com"
  PolicyId="B2C_1A_PasswordReset"
  PublicPolicyUri="http://mineb2c.onmicrosoft.com/B2C_1A_PasswordReset">

  <BasePolicy>
    <TenantId>mineb2c.onmicrosoft.com</TenantId>
    <PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId>
  </BasePolicy>

  <RelyingParty>
    <DefaultUserJourney ReferenceId="PasswordReset" />
    <TechnicalProfile Id="PolicyProfile">
      <DisplayName>PolicyProfile</DisplayName>
      <Protocol Name="OpenIdConnect" />
      <OutputClaims>
        <OutputClaim ClaimTypeReferenceId="email" />
        <OutputClaim ClaimTypeReferenceId="objectId" PartnerClaimType="sub"/>
        <OutputClaim ClaimTypeReferenceId="tenantId" AlwaysUseDefaultValue="true" DefaultValue="{Policy:TenantObjectId}" />
      </OutputClaims>
      <SubjectNamingInfo ClaimType="sub" />
    </TechnicalProfile>
  </RelyingParty>
</TrustFrameworkPolicy>
Dave
  • 13
  • 2

2 Answers2

1

If you have already uploaded your .XML files for B2C_1A_TrustFrameworkExtensions and B2C_1A_TrustFrameworkBase check CTRL-F for "yourtenant" in each one.

The starter pack has "yourtenant.onmicrosoft.com" specified in multiple places\xml files that must be changed (see: https://learn.microsoft.com/en-us/azure/active-directory-b2c/custom-policy-get-started#get-the-starter-pack) .

The portal may have let you upload a base policy referencing yourtenant.onmicrosoft.com and now that you are trying to upload one of the child policies it is erroring due to invalid reference in one of the base policies.

Follow the chain of PolicyId's from:

<BasePolicy>
<TenantId>mineb2c.onmicrosoft.com</TenantId>
<PolicyId>B2C_1A_TrustFrameworkExtensions</PolicyId>
</BasePolicy>

Back to the root policy that has no base policy specified and CTRL-F for "yourtenant" in each one until you find it. Then reupload each policy file starting from the base and you should be able to upload the relying party policy successfully.

floyd
  • 2,080
  • 4
  • 17
  • 19
  • I already did that. What I ended up doing was copying and pasting the TenantID and PolicyID pieces together again. That solved my problem. I must have had a typo I didn't see. Thanks for the suggestion. – Dave Mar 15 '21 at 16:15
0

What I ended up doing was copying and pasting the TenantID and PolicyID pieces together again. That solved my problem. I must have had a typo I didn't see.

Dave
  • 13
  • 2