I am trying to add collect user details using LocalAccountSignUpWithLogonName custom policy.I have added <OutputClaim ClaimTypeReferenceId="email" />
to LocalAccountSignUpWithLogonName as outputclaim. I want to make the email field optional, but if user enter the email I want to enable the restrictions.Below is my email claim
`
Your Email Address
<DataType>string</DataType>
<DefaultPartnerClaimTypes>
<Protocol Name="OpenIdConnect" PartnerClaimType="email" />
</DefaultPartnerClaimTypes>
<UserHelpText>Email address that can be used to contact you.</UserHelpText>
<UserInputType>TextBox</UserInputType>
<Restriction>
<Pattern RegularExpression="^[a-zA-Z0-9.+!#$%&'^_{}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$" HelpText="Please enter a valid email address." />
</Restriction>
`
But when I add the pattern restriction to claim its making the field mandatory.
It is possible to make the claim optional with restrictions.
I am trying to add collect user details using LocalAccountSignUpWithLogonName custom policy.I have added
<OutputClaim ClaimTypeReferenceId="email" />
toLocalAccountSignUpWithLogonName
as outputclaim. I want to make the email field optional, but if user enter the email I want to enable the restrictions.Below is my email claim ``
But when I add the pattern restriction to claim its making the field mandatory. It is possible to make the claim optional with restrictions.