Return-Path: X-Original-To: apmail-directory-dev-archive@www.apache.org Delivered-To: apmail-directory-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id AF38A18540 for ; Fri, 11 Mar 2016 10:28:40 +0000 (UTC) Received: (qmail 1818 invoked by uid 500); 11 Mar 2016 10:28:40 -0000 Delivered-To: apmail-directory-dev-archive@directory.apache.org Received: (qmail 1761 invoked by uid 500); 11 Mar 2016 10:28:40 -0000 Mailing-List: contact dev-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Apache Directory Developers List" Delivered-To: mailing list dev@directory.apache.org Received: (qmail 1751 invoked by uid 99); 11 Mar 2016 10:28:40 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Mar 2016 10:28:40 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 49AFB2C1F5C for ; Fri, 11 Mar 2016 10:28:40 +0000 (UTC) Date: Fri, 11 Mar 2016 10:28:40 +0000 (UTC) From: "Peter Jamieson (JIRA)" To: dev@directory.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (DIRSERVER-2131) cannot log in with ads-pwdmustchange true MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/DIRSERVER-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15189478#comment-15189478 ] Peter Jamieson edited comment on DIRSERVER-2131 at 3/11/16 10:28 AM: --------------------------------------------------------------------- I wrote a unit test for this for my embedded application: - {code} @Test public void testDIRSERVER2131() throws IOException, LdapException { try(LdapNetworkConnection conn = new LdapNetworkConnection("localhost", 11389)) { BindRequest bindRequest = new BindRequestImpl(); bindRequest.setDn(dnUser1); bindRequest.setCredentials(DEFAULT_PASSWORD); bindRequest.addControl(new PasswordPolicyImpl()); BindResponse bindResponse = conn.bind(bindRequest); assertEquals(ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()); assertEquals(PasswordPolicyErrorEnum.CHANGE_AFTER_RESET, ((PasswordPolicy) bindResponse.getControl(PasswordPolicy.OID)).getResponse().getPasswordPolicyError()); PasswordModifyRequest passModRequest = new PasswordModifyRequestImpl(); passModRequest.setUserIdentity(Dn.getBytes(dnUser1)); passModRequest.setOldPassword(DEFAULT_PASSWORD.getBytes()); passModRequest.setNewPassword("five5five%".getBytes()); ExtendedResponse passModResponse = conn.extended(passModRequest); assertTrue(passModResponse instanceof PasswordModifyResponse); assertEquals(ResultCodeEnum.SUCCESS, ((PasswordModifyResponse) passModResponse).getLdapResult().getResultCode()); } } {code} The response from the final object is actually "NO_SUCH_OBJECT". was (Author: peterjam28): I wrote a unit test for this for my embedded application: - {code} @Test public void testDIRSERVER2131() throws IOException, LdapException { try(LdapNetworkConnection conn = new LdapNetworkConnection("localhost", 11389)) { BindRequest bindRequest = new BindRequestImpl(); bindRequest.setDn(dnUser1); bindRequest.setCredentials(DEFAULT_PASSWORD); bindRequest.addControl(new PasswordPolicyImpl()); BindResponse bindResponse = conn.bind(bindRequest); assertEquals(ResultCodeEnum.SUCCESS, bindResponse.getLdapResult().getResultCode()); assertEquals(PasswordPolicyErrorEnum.CHANGE_AFTER_RESET, ((PasswordPolicy) bindResponse.getControl(PasswordPolicy.OID)).getResponse().getPasswordPolicyError()); PasswordModifyRequest passModRequest = new PasswordModifyRequestImpl(); passModRequest.setUserIdentity(Dn.getBytes(dnUser1)); passModRequest.setOldPassword(DEFAULT_PASSWORD.getBytes()); passModRequest.setNewPassword("five5five%".getBytes()); ExtendedResponse passModResponse = conn.extended(passModRequest); assertTrue(passModResponse instanceof PasswordModifyResponse); assertEquals(ResultCodeEnum.SUCCESS, ((PasswordModifyResponse) passModResponse).getLdapResult().getResultCode()); } } {code} The response from the final object is actually "NO_SUCH_OBJECT". > cannot log in with ads-pwdmustchange true > ----------------------------------------- > > Key: DIRSERVER-2131 > URL: https://issues.apache.org/jira/browse/DIRSERVER-2131 > Project: Directory ApacheDS > Issue Type: Bug > Components: core > Affects Versions: 2.0.0-M21 > Environment: centos 7. > Reporter: Peter Jamieson > > If i modify the authentication policy to set ads-pwdmustchange to TRUE, when i log in, i get: - > {noformat} > provisioning:root *#ssh user2@192.168.56.164 > Authorized users only. All activity may be monitored and reported. > user2@192.168.56.164's password: > Password expired. Change your password now. > Last login: Mon Mar 7 15:46:02 2016 from provisioning > Authorized users only. All activity may be monitored and reported. > WARNING: Your password has expired. > You must change your password now and login again! > Changing password for user user2. > Current Password: > New password: > Retype new password: > Password change failed. Server message: Cannot find an entry for DN uid=user2,ou=users,dc=example,dc=com > passwd: Authentication token manipulation error > Connection to 192.168.56.164 closed. > {noformat} > and this appears in the apacheds.log: - > [15:46:33] ERROR [org.apache.directory.server.ldap.handlers.extended.PwdModifyHandler] - Cannot find an entry for DN uid=user2,ou=users,dc=example,dc=com, exception : password needs to be reset before performing this operation -- This message was sent by Atlassian JIRA (v6.3.4#6332)