All,
I've recently begun adding attributes to our test CAS environment for a new
project we are working on. I've gone into the Services Management Web GUI to
enable the attributes that I would like, but when I review the XML response
from the authentication, I do not see any attributes listed.
Below is part of my configuration:
casServiceValidationSuccess.jsp:
<c:forEach var="auth" items="${assertion.chainedAuthentications}">
<c:forEach var="attr" items="${auth.principal.attributes}" >
<cas:attribute name="${fn:escapeXml(attr.key)}"
value="${fn:escapeXml(attr.value)}"/>
</c:forEach>
</c:forEach>
<c:if test="${not empty pgtIou}">
<cas:proxyGrantingTicket>${pgtIou}</cas:proxyGrantingTicket>
</c:if>
<c:if test="${fn:length(assertion.chainedAuthentications) > 1}">
<cas:proxies>
<c:forEach var="proxy" items="${assertion.chainedAuthentications}"
varStatus="loopStatus" begin="0"
end="${fn:length(assertion.chainedAuthentications)-2}" step="1">
<cas:proxy>${fn:escapeXml(proxy.principal.id)}</cas:proxy>
</c:forEach>
</cas:proxies>
</c:if>
</cas:authenticationSuccess>
</cas:serviceResponse>
deployerConfigContext.xml:
## Modified UsernamePasswordCredentialstoPrincipalResolver bean to reference
attributeRepository
<bean
class="org.jasig.cas.authentication.principal.UsernamePasswordCredentialsToPrincipalResolver"
>
<property name="attributeRepository" ref="attributeRepository"
/>
</bean>
##authenticationHandler
<bean class="org.jasig.cas.adaptors.ldap.BindLdapAuthenticationHandler"
p:filter="sAMAccountName=%u"
p:searchBase="cn=Users,dc=testad,dc=local"
p:contextSource-ref="contextSource"
p:searchContextSource-ref="pooledContextSource"
p:ignorePartialResultException="true" />
##attributeRepository Config
<bean id="attributeRepository"
class="org.jasig.services.persondir.support.ldap.LdapPersonAttributeDao">
<property name="contextSource" ref="contextSource" />
<property name="baseDN" value="cn=Users,dc=testad,dc=local" />
<property name="requireAllQueryAttributes" value="true" />
<!--
<property name="query" value="(uid={0})" />
-->
<property name="queryAttributeMapping">
<map>
<entry key="username" value="uid" />
</map>
</property>
<property name="resultAttributeMapping">
<map>
<entry value="Name" key="cn" />
<entry value="employeeId" key="employeeId" />
</map>
</property>
</bean>
The Attribute that I want to come back for this test is the employeeId
attribute that we have populated in our AD Schema. Here is the xml response
that I receive back when I authenticate:
<cas:serviceResponse>
<cas:authenticationSuccess>
<cas:user>bbranch</cas:user>
</cas:authenticationSuccess>
</cas:serviceResponse>
If I go into the casServiceValidationSuccess.jsp and manually add
<cas:attribute name="employeeId" value="test_value" />, I see the value that I
put in the casServiceValidationSuccess.jsp in my XML response then. Is there
something that I'm missing here?
Ben Branch
UNIX/Linux Administrator
University of Central Oklahoma
ITIL Foundation v3, Network+, RHCSA
100 N. University Drive, Box 122
Edmond, OK 73034
D: 405.974.2649 | M: 405.550.6804 | bbranch@uco.<mailto:bbranch@uco.>edu |
www.uco.edu<http://www.uco.edu/>
"I am wiser than this man, for neither of us appears to know anything great and
good; but he fancies he knows something, although he knows nothing; whereas I,
as I do not know anything, so I do not fancy I do. In this trifling particular,
then, I appear to be wiser than he, because I do not fancy I know what I do not
know." - Socrates
--
You are currently subscribed to [email protected] as:
[email protected]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-user