<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Dec 9, 2016 at 5:20 PM, O'Dowd, Josh <span dir="ltr"><<a href="mailto:Josh.O'Dowd@mso.umt.edu" target="_blank">Josh.O'Dowd@mso.umt.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
We are trying to take advantage of an option in the OLDAP to force a user to change their password on next login.  We have successfully implemented this at the Directory but I am having trouble finding the best way to handle this at the IdP(v3.3.0).  I have tuned logging to TRACE the authentication response, see below:<br>
TRACE [net.shibboleth.idp.authn.<wbr>impl.<wbr>ValidateUsernamePasswordAgains<wbr>tLDAP:150] - Profile Action ValidateUsernamePasswordAgains<wbr>tLDAP: Authentication response [org.ldaptive.auth.<wbr>AuthenticationResponse@<wbr>1130903839::<wbr>authenticationResultCode=<wbr>AUTHENTICATION_HANDLER_<wbr>SUCCESS, ldapEntry=[dn=uid=xxxxxxx,ou=<wbr>people,dc=umt,dc=edu[]], accountState=[org.ldaptive.<wbr>auth.ext.<wbr>PasswordPolicyAccountState@<wbr>1392004071::accountWarnings=<wbr>null, accountErrors=[CHANGE_AFTER_<wbr>RESET]], result=true, resultCode=SUCCESS, message=null, controls=[[org.ldaptive.<wbr>control.PasswordPolicyControl@<wbr>1346651430::criticality=false, timeBeforeExpiration=0, graceAuthNsRemaining=0, error=CHANGE_AFTER_RESET]]]<br>
Notice the CHANGE_AFTER_RESET coming in as an accountError.</blockquote><div><br></div><div>Don't get too hung up on the language, it just mirrors what is in the RFC[1]. These aren't errors in the strictest sense.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
That being said I have tried mapping the error code into the ClassifiedMessageMap in conf/authn/password-authn-<wbr>config.xml, to an event which I have added to the flows/authn/conditions/<wbr>conditions-flow.xml as a transition to the expired-password sub-flow.</blockquote><div><br></div><div>Your configuration looks like this?</div><div><br></div><div><div><div>        <entry key="ExpiredPassword"></div><div>            <list></div><div>                <value>PASSWORD_EXPIRED</value></div><div>                <value>CHANGE_AFTER_RESET</value></div><div>            </list></div><div>        </entry></div></div></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">  That did not work.  Maybe because there is no exception when the authenticationResultCode=<wbr>AUTHENTICATION_HANDLER_<wbr>SUCCESS?<br></blockquote><div><br></div><div><div>No. An exception always fires the AUTHN_EXCEPTION event.</div></div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
Is there a provided method for the IdP to handle a PPolicy accountError in the ldaptive response when the authn result code happens to be ‘success’?<br></blockquote><div><br></div><div>Yes. You should see an AuthenticationWarningContext added to the AuthenticationContext. If you do, it's just a matter of getting the correct flow to fire.</div><div><br></div><div>--Daniel Fisher</div><div><br></div><div>[1] <a href="https://tools.ietf.org/html/draft-behera-ldap-password-policy-10#section-6.2">https://tools.ietf.org/html/draft-behera-ldap-password-policy-10#section-6.2</a></div><div><br></div></div></div></div>