0
votes

Following is a response to my GET request "http://localhost:8080/cas/p3/serviceValidate?service=http://localhost:8080/cas/v1/tickets/TGT-1-BzIAvxpfhaxZ1lHkkzWDXxpnTCweeollK7tnMR5OKXsE6Akfnw-cas01.example.org&ticket=ST-1-eNUEfrlGTcbOrukHewtR-cas01.example.org"

Response

<cas:serviceResponse 
    xmlns:cas='http://www.yale.edu/tp/cas'>
    <cas:authenticationSuccess>
        <cas:user>casuser</cas:user>
    </cas:authenticationSuccess>
</cas:serviceResponse>

How can we return additional parameters or user attributes in GET response to look something like following ?

Expected

<cas:serviceResponse 
    xmlns:cas='http://www.yale.edu/tp/cas'>
    <cas:authenticationSuccess>
        <cas:user>casuser</cas:user>
        <cas:email>[email protected]<cas:email>
        <cas:firstname>First name<firstname>
        <cas:lastname>Lastname<cas:lastname>
    </cas:authenticationSuccess>
</cas:serviceResponse>

CAS version 4.0.0

1

1 Answers

0
votes

Per the CAS documentation,

Attributes are controlled by the Person Directory project and returned to scoped services via the SAML 1.1 protocol or the CAS protocol. The Person Directory dependency is automatically bundled with the CAS server. Therefore, declaring an additional dependency will not be required. This Person Directory project supports both LDAP and JDBC attribute release, caching, attribute aggregation from multiple attribute sources, etc.

Attributes pass through a two-step process:

Resolution: Done at the time of establishing the principal via PrincipalResolver components where attributes are resolved from various sources that are outlined below.

Release: Adopters must explicitly configure attribute release for services in order for the resolved attributes to be released to a service in the validation response.

Once principal attributes are resolved, adopters may choose to allow/release each attribute per each definition in the registry. Example configuration follows:

<bean class="org.jasig.cas.services.RegisteredServiceImpl">
  <property name="id" value="0" />
  <property name="name" value="HTTPS Services" />
  <property name="description" value="YOUR HTTP Service" />
  <property name="serviceId" value="https://**" />
  <property name="allowedAttributes">
    <list>
      <value>yourAttributeName</value>
    </list>              
  </property>
</bean>