with b2c custom policy, capture checkbox state during profile editing

Steve Bi 0 Reputation points
2024-05-20T16:04:16.6066667+00:00

We have b2c custom policy, we have checkbox to give user options on "Agree to receive email..." checkbox implemented with CheckboxMultiSelect as the only option, it capture value for the first time. But when user later on uncheck the checkbox, the value can not updated anymore.

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

1 answer

Sort by: Most helpful
  1. James Hamil 22,871 Reputation points Microsoft Employee
    2024-05-20T21:32:02.9766667+00:00

    Hi @Steve Bi , you'll have to use a Persisted Claim element in your custom policy. This element allows you to store the value of the checkbox in the user's profile, so that it can be retrieved and updated later. For example from the document:

    <PersistedClaims>
      <PersistedClaim ClaimTypeReferenceId="email" PartnerClaimType="signInNames.emailAddress" />
      <PersistedClaim ClaimTypeReferenceId="newPassword" PartnerClaimType="password"/>
      <PersistedClaim ClaimTypeReferenceId="displayName" DefaultValue="unknown" />
      <PersistedClaim ClaimTypeReferenceId="passwordPolicies" DefaultValue="DisablePasswordExpiration" />
      <PersistedClaim ClaimTypeReferenceId="givenName" />
      <PersistedClaim ClaimTypeReferenceId="surname" />
    </PersistedClaims>
    
    
    

    Please let me know if you have any questions and I can help you further.

    If this answer helps you please mark "Accept Answer" so other users can reference it.

    Thank you,

    James