0
votes

I'm using B2C custom policies for local and social accounts. I understand that with custom policies the password expires in 90 days and I can remove expiration for each user individually with this procedures: Azure AD B2C password expiration But I want to update the custom policy so new users have the no expiration behavior.

How can I accomplish this?

Thanks in advance! Germán

1

1 Answers

0
votes

To disable expiration of passwords, you must set the passwordPolicies property of the user object to "DisablePasswordExpiration", as follows:

1) Declare the passwordPolicies claim type:

<ClaimType Id="passwordPolicies">
  <DisplayName>Password Policies</DisplayName>
  <DataType>string</DataType>
</ClaimType>

2) Default the passwordPolicies claim to "DisablePasswordExpiration" when the user account is created:

<TechnicalProfile Id="AAD-UserWriteUsingLogonEmail">
  <PersistedClaims>
    <PersistedClaim ClaimTypeReferenceId="passwordPolicies" DefaultValue="DisablePasswordExpiration" />
  </PersistedClaims>
</TechnicalProfile>

Refer to the custom policy starter pack for examples of this.