idpv3.x user password as attribute

Raffael Sahli sahli at gyselroth.com
Wed Mar 18 11:06:48 EDT 2015


Hi

I was able to release the user password as attribute with 2.4.x.

By enabling the following option in src/main/webapp/WEB-INF/web.xml:
retainSubjectsPrivateCredentials = true


...and a scripted attribute like:

"
importPackage(Packages.edu.internet2.middleware.shibboleth.common.attribute.provider); 

importPackage(Packages.edu.internet2.middleware.shibboleth.idp.authn.provider);

                   password = new BasicAttribute("password");
                   if( requestContext.getUserSession() ) {
                       userSubject = 
requestContext.getUserSession().getSubject();
                       i = 
userSubject.getPrivateCredentials(edu.internet2.middleware.shibboleth.idp.authn.provider.UsernamePasswordCredential).iterator();
                       while(i.hasNext()) {
                          credential = i.next();
password.getValues().add(credential.getPassword());
                      }
                 }
"


"retainSubjectsPrivateCredentials" seems gone in 3.x web.xml and with 
the scripted attribute only, I get the following error:
[edu.internet2.middleware.shibboleth.common.attribute.provider.V2SAMLProfileRequestContext:911] 
- AttributeDefinition: 'password' called unsupported method getUserSession

But there is a compatibility v2 description for requestContext which 
says "requestContext" does include all v2 methods (including 
getUserSession?)
(https://wiki.shibboleth.net/confluence/display/IDP30/ScriptedAttributeDefinition#ScriptedAttributeDefinition-V2Compatibility)



I see a lot of changes within 3.x, is it still possible
to release the user password with idp 3.x?



Thanks

Raffael Sahli



More information about the users mailing list