Updates the authentication and password policy settings by sending a serialized AuthenticationAndPasswordPolicy object. This API allows you to configure password complexity rules, expiration policies, and actions that require password re-confirmation.
/srv.asmx/SetAuthenticationAndPasswordPolicy
/srv.asmx/SetAuthenticationAndPasswordPolicy?authenticationTicket=...&settingsXml=.../srv.asmx/SetAuthenticationAndPasswordPolicy (form data)http://tempuri.org/SetAuthenticationAndPasswordPolicyThe
settingsXmlvalue must contain theAuthenticationAndPasswordPolicyXML. Always URL-encode the XML when calling the GET endpoint.
| Parameter | Type | Required | Description |
|---|---|---|---|
authenticationTicket |
string | Yes | Ticket returned by AuthenticateUser. The caller must have UpdateApplicationSettingsAndPolicies admin permission. |
settingsXml |
string | Yes | XML representation of the AuthenticationAndPasswordPolicy object. Obtain the current structure via GetAuthenticationAndPasswordPolicy, update the desired values, then submit the modified XML here. |
<root success="true" />
<root success="false" error="[ErrorCode] Error message" />
Typical errors:
[2730] when the user is not authenticatedUpdateApplicationSettingsAndPolicies permissionInvalid settings XML format when the payload cannot be deserializedUpdateAuthenticationAndPasswordPolicySettings (for validation failures)UpdateApplicationSettingsAndPolicies admin permissionPOST /srv.asmx/SetAuthenticationAndPasswordPolicy HTTP/1.1
Content-Type: application/x-www-form-urlencoded
authenticationTicket=6F9C2A...&
settingsXml=%3CAuthenticationAndPasswordPolicy%3E...%3C%2FAuthenticationAndPasswordPolicy%3E
POST /srv.asmx HTTP/1.1
Content-Type: text/xml; charset=utf-8
SOAPAction: "http://tempuri.org/SetAuthenticationAndPasswordPolicy"
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<SetAuthenticationAndPasswordPolicy xmlns="http://tempuri.org/">
<authenticationTicket>6F9C2A...</authenticationTicket>
<settingsXml><![CDATA[
<AuthenticationAndPasswordPolicy>
<PasswordPolicy>
<Expires>90</Expires>
<MinLen>8</MinLen>
<MustIncludeAlphaNumericCharacters>true</MustIncludeAlphaNumericCharacters>
<MustIncludeNumericCharacters>true</MustIncludeNumericCharacters>
<MustIncludeNonAlphaNumericCharacters>true</MustIncludeNonAlphaNumericCharacters>
<MustNotEqualEmailAddress>true</MustNotEqualEmailAddress>
<MustNotEqualUserName>true</MustNotEqualUserName>
<MustNotInCommonPasswordList>true</MustNotInCommonPasswordList>
</PasswordPolicy>
<PasswordRePromptActions>
<DomainDelete>true</DomainDelete>
<OnDelete>true</OnDelete>
<UserDelete>true</UserDelete>
<SecurityApply>true</SecurityApply>
<OnOwnerChange>true</OnOwnerChange>
<OnClassify>false</OnClassify>
<OnReviewTask>false</OnReviewTask>
</PasswordRePromptActions>
</AuthenticationAndPasswordPolicy>
]]></settingsXml>
</SetAuthenticationAndPasswordPolicy>
</soap:Body>
</soap:Envelope>
settingsXml Payload<AuthenticationAndPasswordPolicy>
<PasswordPolicy>
<Expires>90</Expires>
<MinLen>8</MinLen>
<MustIncludeAlphaNumericCharacters>true</MustIncludeAlphaNumericCharacters>
<MustIncludeNumericCharacters>true</MustIncludeNumericCharacters>
<MustIncludeNonAlphaNumericCharacters>true</MustIncludeNonAlphaNumericCharacters>
<MustNotEqualEmailAddress>true</MustNotEqualEmailAddress>
<MustNotEqualUserName>true</MustNotEqualUserName>
<MustNotInCommonPasswordList>true</MustNotInCommonPasswordList>
</PasswordPolicy>
<PasswordRePromptActions>
<DomainDelete>true</DomainDelete>
<OnDelete>true</OnDelete>
<UserDelete>true</UserDelete>
<SecurityApply>true</SecurityApply>
<OnOwnerChange>true</OnOwnerChange>
<OnClassify>false</OnClassify>
<OnReviewTask>false</OnReviewTask>
</PasswordRePromptActions>
</AuthenticationAndPasswordPolicy>
| Property | Type | Description |
|---|---|---|
Expires |
integer | Password expiration in days (0 = never expires) |
MinLen |
short | Minimum password length (1-14 characters) |
MustIncludeAlphaNumericCharacters |
boolean | Require alphabetic characters |
MustIncludeNumericCharacters |
boolean | Require numeric characters |
MustIncludeNonAlphaNumericCharacters |
boolean | Require special characters (!@#$%^&*) |
MustNotEqualEmailAddress |
boolean | Password cannot equal user’s email |
MustNotEqualUserName |
boolean | Password cannot equal username |
MustNotInCommonPasswordList |
boolean | Reject common/weak passwords |
| Property | Type | Description |
|---|---|---|
DomainDelete |
boolean | Re-prompt password when deleting a domain |
OnDelete |
boolean | Re-prompt password when deleting items |
UserDelete |
boolean | Re-prompt password when deleting users |
SecurityApply |
boolean | Re-prompt password when applying security |
OnOwnerChange |
boolean | Re-prompt password when changing ownership |
OnClassify |
boolean | Re-prompt password when classifying documents |
OnReviewTask |
boolean | Re-prompt password on review tasks |
GetAuthenticationAndPasswordPolicy to retrieve the current settingsSetAuthenticationAndPasswordPolicy0 to disable password expiration<PasswordPolicy>
<Expires>90</Expires>
<MinLen>12</MinLen>
<MustIncludeAlphaNumericCharacters>true</MustIncludeAlphaNumericCharacters>
<MustIncludeNumericCharacters>true</MustIncludeNumericCharacters>
<MustIncludeNonAlphaNumericCharacters>true</MustIncludeNonAlphaNumericCharacters>
<MustNotEqualEmailAddress>true</MustNotEqualEmailAddress>
<MustNotEqualUserName>true</MustNotEqualUserName>
<MustNotInCommonPasswordList>true</MustNotInCommonPasswordList>
</PasswordPolicy>
<PasswordRePromptActions>
<DomainDelete>true</DomainDelete>
<OnDelete>true</OnDelete>
<UserDelete>true</UserDelete>
<SecurityApply>true</SecurityApply>
<OnOwnerChange>true</OnOwnerChange>
<!-- Less critical operations -->
<OnClassify>false</OnClassify>
<OnReviewTask>false</OnReviewTask>
</PasswordRePromptActions>
GetAuthenticationAndPasswordPolicy - Retrieve current policy settingsGetSystemBehaviorSettings - Get login logging and delay settingsSetSystemBehaviorSettings - Update system behavior settingsChangeUserPassword - Change a user’s passwordCreateUser - Create new user with passwordusing System.Xml.Linq;
using System.Xml.Serialization;
// Get current policy
var getPolicyResponse = await client.GetAuthenticationAndPasswordPolicyAsync(authTicket);
var currentPolicy = DeserializePolicy(getPolicyResponse);
// Modify policy
currentPolicy.PasswordPolicy.Expires = 90;
currentPolicy.PasswordPolicy.MinLen = 12;
currentPolicy.PasswordPolicy.MustIncludeNumericCharacters = true;
currentPolicy.PasswordPolicy.MustIncludeNonAlphaNumericCharacters = true;
// Serialize to XML
var serializer = new XmlSerializer(typeof(AuthenticationAndPasswordPolicy));
string settingsXml;
using (var writer = new StringWriter())
{
serializer.Serialize(writer, currentPolicy);
settingsXml = writer.ToString();
}
// Update policy
var updateResponse = await client.SetAuthenticationAndPasswordPolicyAsync(
authTicket,
settingsXml
);
if (updateResponse.Root.Attribute("success")?.Value == "true")
{
Console.WriteLine("Password policy updated successfully");
}
else
{
var error = updateResponse.Root.Attribute("error")?.Value;
Console.WriteLine($"Error updating policy: {error}");
}
AuthenticationAndPasswordPolicy is serializable for XML transport