Update the password policy implementation to use ds-pwp-password-policy-dn
instead of pwdPolicySubentry for indicating which password policy should be
applied for a given user. The new attribute is not marked NO-USER-MODIFICATION
so that it can be directly altered by administrators in addition to having a
value populated by a virtual attribute. The pwdPolicySubentry attribute is
defined in the IETF draft as NO-USER-MODIFICATION and is only intended to be
virtually defined, making it more difficult to configure a special policy for
an individual user.
This also eliminates the possibility that clients will see this attribute and
will expect the corresponding password policy configuration to be based on the
specification in the IETF draft, which is not the case for OpenDS.
OpenDS Issue Number: 1003
| | |
| | | objectClass: ds-cfg-password-policy |
| | | cn: Root Password Policy |
| | | ds-cfg-password-attribute: userPassword |
| | | ds-cfg-default-password-storage-scheme: SSHA512 |
| | | ds-cfg-default-password-storage-scheme: SSHA |
| | | ds-cfg-allow-expired-password-changes: false |
| | | ds-cfg-allow-multiple-password-values: false |
| | | ds-cfg-allow-pre-encoded-passwords: false |
| | |
| | | ds-rlim-size-limit: 0 |
| | | ds-rlim-time-limit: 0 |
| | | ds-rlim-lookthrough-limit: 0 |
| | | pwdPolicySubentry: cn=Root Password Policy,cn=Password Policies,cn=config |
| | | ds-pwp-password-policy-dn: cn=Root Password Policy,cn=Password Policies,cn=config |
| | | |
| | | dn: cn=Root DSE,cn=config |
| | | objectClass: top |
| | |
| | | attributeTypes: ( 1.3.6.1.4.1.26027.1.1.287 NAME 'ds-cfg-backend-mode' |
| | | SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE |
| | | X-ORIGIN 'OpenDS Directory Server' ) |
| | | attributeTypes: ( 1.3.6.1.4.1.26027.1.1.288 NAME 'ds-pwp-password-policy-dn' |
| | | SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 USAGE directoryOperation |
| | | X-ORIGIN 'OpenDS Directory Server' ) |
| | | objectClasses: ( 1.3.6.1.4.1.26027.1.2.1 |
| | | NAME 'ds-cfg-access-control-handler' SUP top STRUCTURAL |
| | | MUST ( cn $ ds-cfg-acl-handler-class $ ds-cfg-acl-handler-enabled ) |
| | |
| | | * The name of the operational attribute that will appear in a user's entry to |
| | | * indicate which password policy should be used. |
| | | */ |
| | | public static final String OP_ATTR_PWPOLICY_SUBENTRY = |
| | | "pwdPolicySubentry"; |
| | | |
| | | |
| | | |
| | | /** |
| | | * The name of the password policy subentry attribute, in all lowercase |
| | | * characters. |
| | | */ |
| | | public static final String OP_ATTR_PWPOLICY_SUBENTRY_LC = |
| | | "pwdpolicysubentry"; |
| | | public static final String OP_ATTR_PWPOLICY_POLICY_DN = |
| | | "ds-pwp-password-policy-dn"; |
| | | |
| | | |
| | | |
| | |
| | | // attribute. |
| | | PasswordPolicy pwPolicy = null; |
| | | List<Attribute> pwAttrList = |
| | | entry.getAttribute(OP_ATTR_PWPOLICY_SUBENTRY_LC); |
| | | entry.getAttribute(OP_ATTR_PWPOLICY_POLICY_DN); |
| | | if ((pwAttrList != null) && (! pwAttrList.isEmpty())) |
| | | { |
| | | Attribute a = pwAttrList.get(0); |
| | |
| | | assert debugEnter(CLASS_NAME, "getPasswordPolicy"); |
| | | |
| | | |
| | | // See if the user entry contains the pwdPolicySubentry attribute to select |
| | | // a custom objectclass (whether real or virtual). |
| | | // See if the user entry contains the ds-pwp-password-policy-dn attribute to |
| | | // select a custom objectclass (whether real or virtual). |
| | | AttributeType type = |
| | | DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_SUBENTRY_LC); |
| | | if (type == null) |
| | | { |
| | | type = DirectoryServer.getDefaultAttributeType(OP_ATTR_PWPOLICY_SUBENTRY); |
| | | } |
| | | DirectoryServer.getAttributeType(OP_ATTR_PWPOLICY_POLICY_DN, true); |
| | | |
| | | List<Attribute> attrList = userEntry.getAttribute(type); |
| | | if ((attrList == null) || attrList.isEmpty()) |
| | |
| | | |
| | | registerMessage(MSGID_PWPSTATE_CANNOT_DECODE_SUBENTRY_VALUE_AS_DN, |
| | | "An error occurred while attempting to decode the " + |
| | | OP_ATTR_PWPOLICY_SUBENTRY + " value \"%s\" in user entry " + |
| | | "\"%s\" as a DN: %s."); |
| | | OP_ATTR_PWPOLICY_POLICY_DN + " value \"%s\" in user " + |
| | | "entry \"%s\" as a DN: %s."); |
| | | registerMessage(MSGID_PWPSTATE_NO_SUCH_POLICY, |
| | | "User entry %s is configured to use a password policy " + |
| | | "subentry of %s but no such password policy has been " + |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy,cn=Password " + |
| | | "Policies,cn=config"); |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy,cn=Password " + |
| | | "Policies,cn=config"); |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy,cn=Password " + |
| | | "Policies,cn=config"); |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy,cn=Password " + |
| | | "Policies,cn=config"); |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: " + password, |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "cn: Second Root DN", |
| | | "ds-cfg-alternate-bind-dn: cn=Second Root DN", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "cn: Test User", |
| | | "authPassword: password", |
| | | "authPassword: password2", |
| | | "pwdPolicySubentry: cn=SHA1 AuthPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=SHA1 AuthPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | |
| | |
| | | "sn: User2", |
| | | "cn: Test User2", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=SSHA512 UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=SSHA512 UserPassword Policy," + |
| | | "cn=Password Policies,cn=config", |
| | | "", |
| | | "dn: uid=test.user3,o=test", |
| | |
| | | "sn: User3", |
| | | "cn: Test User3", |
| | | "authPassword: password", |
| | | "pwdPolicySubentry: cn=SHA1 AuthPassword Policy,cn=Password Policies," + |
| | | "cn=config" |
| | | "ds-pwp-password-policy-dn: cn=SHA1 AuthPassword Policy," + |
| | | "cn=Password Policies,cn=config" |
| | | }; |
| | | |
| | | String ldifString = TestCaseUtils.makeLdif(entryLines); |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |
| | |
| | | "sn: User", |
| | | "cn: Test User", |
| | | "userPassword: password", |
| | | "pwdPolicySubentry: cn=Clear UserPassword Policy," + |
| | | "ds-pwp-password-policy-dn: cn=Clear UserPassword Policy," + |
| | | "cn=Password Policies,cn=config"); |
| | | |
| | | InternalClientConnection conn = |