Shibboleth SP's attributes

47 views
Skip to first unread message

Dorin Marian Rautu

unread,
Sep 17, 2013, 10:39:11 AM9/17/13
to cas...@googlegroups.com
Hello all,

Maybe is me that has not searched enough, but is there a way, or is casshib making available all the attributes that ShibbolethSP resolves from the host's LDAP/AD? If yes, how can I get this attributes from casshib session?

Thank you in advance!

Dorin

bko...@gmail.com

unread,
Oct 8, 2013, 5:39:14 PM10/8/13
to cas...@googlegroups.com
You can configure the attributes you want to make available in attribute-map.xml
This is documented: http://code.google.com/p/casshib/wiki/ShibbolethApacheTomcatInstallationAndConfigurationForCASShib

Then in a JSP or servlet, you would access it via something like:

  org.jasig.cas.client.validation.Assertion assertion = (org.jasig.cas.client.validation.Assertion)session.getAttribute("_const_cas_assertion_");
  if(assertion != null)
  {
    java.util.Iterator it = assertion.getPrincipal().getAttributes().keySet().iterator();
    while(it.hasNext())
    {
      String name = (String)it.next();
      Object value = assertion.getPrincipal().getAttributes().get(name);
      out.println(name + " = " + value.toString());
    }
  }
Reply all
Reply to author
Forward
0 new messages