<div dir="ltr">It's been quite a while, but someone reminded me that I hadn't posted my solution here.<div>So, here is mime, and any better one is appreciated:</div><div><br></div><div><div> <resolver:AttributeDefinition id="password" xsi:type="ad:Script"></div><div> <resolver:AttributeEncoder xsi:type="enc:SAML2String" name="<a href="https://my.host/attributes/password">https://my.host/attributes/password</a>" friendlyName="password" encodeType="false" /></div><div> <ad:Script></div><div> <![CDATA[</div><div> subjectCtx = profileContext.getSubcontext("net.shibboleth.idp.authn.context.SubjectContext");</div><div> subject = subjectCtx.getSubjects()[0];</div><div> password.addValue(subject.getPrivateCredentials().toArray()[0].getName());</div><div> ]]></div><div> </ad:Script></div><div> </resolver:AttributeDefinition></div></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 11, 2016 at 9:02 AM, joller lee <span dir="ltr"><<a href="mailto:joller.lee@gmail.com" target="_blank">joller.lee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Oops, I just took a look at the source code and found the getName() method returns the password.<div>I guess that is the way.</div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Mar 11, 2016 at 8:43 AM, joller lee <span dir="ltr"><<a href="mailto:joller.lee@gmail.com" target="_blank">joller.lee@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Thu, Mar 10, 2016 at 10:42 PM, Cantor, Scott <span dir="ltr"><<a href="mailto:cantor.2@osu.edu" target="_blank">cantor.2@osu.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>> But now I get a Subject, in which I get one PasswordPrincipal as the private<br>
> credential, with the password being "<elided>".<br>
> That is not what I expected.<br>
> Is there anything missing?<br>
<br>
</span>You're converting the object as a string, and that isn't how you would access the data inside it.</blockquote><div><br></div></span><div>Sorry, but I didn't see any accessor to read the password field.</div><div>What is the correct way to access its value?</div><div><br></div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>