Azure AD B2C Custom Policy Update User Attribute W

2019-07-31 02:14发布

问题:

I'm currently testing out a theory with Azure AD B2C that requires an update of a value on a user profile with a static value that is not input by a user. I have attempted to try and follow the path of a profile edit example but can't seem to make it work. At this point it does not matter what value I update I just want to be able to update a value, I have chosen the "state" attribute for this experiment.

I have the following orchestration step in a user journey:

<OrchestrationStep Order="5" Type="ClaimsExchange">
   <ClaimsExchanges>
      <ClaimsExchange Id="UpdateStateValue" TechnicalProfileReferenceId="LocalAccountUpdateStateValue" /
   </ClaimsExchanges>
</OrchestrationStep>

The technical profiles are as follows:

<TechnicalProfile Id="LocalAccountUpdateStateValue">
   <DisplayName>Update Password Set Value</DisplayName>
   <Protocol Name="Proprietary" Handler="Web.TPEngine.Providers.SelfAssertedAttributeProvider, Web.TPEngine, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
   <Metadata>
      <Item Key="ContentDefinitionReferenceId">api.selfasserted</Item>
   </Metadata>
   <CryptographicKeys>
      <Key Id="issuer_secret" StorageReferenceId="B2C_1A_TokenSigningKeyContainer" />
   </CryptographicKeys>
  <InputClaims>
     <InputClaim ClaimTypeReferenceId="objectId" />
  </InputClaims>
  <OutputClaims>
  </OutputClaims>
  <ValidationTechnicalProfiles>
     <ValidationTechnicalProfile ReferenceId="AAD-UserUpdateStateValue" />
  </ValidationTechnicalProfiles>
</TechnicalProfile>
<TechnicalProfile Id="AAD-UserUpdateStateValue">
   <Metadata>
      <Item Key="Operation">Write</Item>
      <Item Key="RaiseErrorIfClaimsPrincipalAlreadyExists">false</Item>
      <Item Key="RaiseErrorIfClaimsPrincipalDoesNotExist">true</Item>
   </Metadata>
   <IncludeInSso>false</IncludeInSso>
 <InputClaims>
   <InputClaim ClaimTypeReferenceId="objectId" Required="true" />
 </InputClaims>
 <PersistedClaims>
    <!-- Required claims -->
    <PersistedClaim ClaimTypeReferenceId="objectId" />
    <!-- Optional claims -->
    <PersistedClaim ClaimTypeReferenceId="state" DefaultValue="CA"/>
  </PersistedClaims>
  <IncludeTechnicalProfile ReferenceId="AAD-Common" />
</TechnicalProfile>

What I am basically attempting to do is each time through the user journey update the "state" value to "CA" but it doesn't seem to be working. I first tried to just reference the "AAD-UserUpdateStateValue" technical profile directly without success and then moved towards something more similar to the profile edit example.

We are admittedly new to Azure B2C so any help or reference to articles that could help is appreciated.