<div dir="ltr"><div class="gmail_quote" style="font-size:12.8px"><div>Thanks for Rich's reminding, I'll share my script here.</div><div>I'm not sure whether my implementation is qualified. </div><div>Anyway, it works:</div><div><br></div><div>In conf/attribute-resolver.xml, assuming an LDAP DataConnector "myLDAP" exists, add the following:</div><div><br></div><div><div> <resolver:AttributeDefinition id="passwordExpiration" xsi:type="ad:Script" sourceAttributeID="pwdLastSet"></div><div> <resolver:Dependency ref="myLDAP" /></div><div> <ad:Script></div><div> <![CDATA[</div><div> logger = Java.type("org.slf4j.LoggerFactory").getLogger("net.shibboleth.idp");</div><div> if(typeof pwdLastSet == "undefined" || pwdLastSet.getValues().size() < 1) {</div><div> logger.debug("pwdLastSet not found");</div><div> passwordExpiration.addValue("9999/12/31");</div><div> }</div><div> else {</div><div> pwls = pwdLastSet.getValues().get(0);</div><div> FileTimeValueTranscoder = Java.type("org.ldaptive.ad.io.FileTimeValueTranscoder");<br></div><div> calendar = new FileTimeValueTranscoder().decodeStringValue(pwls);</div><div> calendar.add(Java.type("java.util.Calendar").DATE, 180); // assuming password age of 180 days</div><div> SimpleDateFormat = Java.type("java.text.SimpleDateFormat");<br></div><div> passwordExpiration.addValue(new SimpleDateFormat("yyyy/MM/dd").format(calendar.getTime()));</div><div> }<br></div><div> ]]></div><div> </ad:Script></div><div> </resolver:AttributeDefinition></div></div><div><br></div></div><span style="font-size:12.8px">In conf/ldap.properties, add "pwdLastSet" to the property "idp.attribute.resolver.LDAP.</span><span style="font-size:12.8px">returnAttributes".</span><br><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Please note that the pattern used for SimpleDateFormat in my script doesn't match the default one in expiring-password-intercept-config.xml, so you have to modify either of them to make sure they match.</span></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">I believe it's possible to fulfill my need with a scripted predicate in </span><span style="font-size:12.8px">expiring-password-intercept-config.xml solely, but I don't know how to do it presently. </span></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 15, 2016 at 10:47 PM, Rich Graves <span dir="ltr"><<a href="mailto:rgraves@carleton.edu" target="_blank">rgraves@carleton.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="font-family:'Calibri','sans-serif'"><span class=""><div><span style="font-family:sans-serif">> I ended up making it with scripted attribute</span><span style="font-family:sans-serif"> </span></div><div><br></div></span><div>Share the script either on-list or in the wiki?</div><div>-- </div><div>Rich Graves</div>
</div><br>
</blockquote></div><br></div>