Hello Fredrik, I found a solution to clean DN of groups directly into the file "casServiceValidationSuccess.jsp". Here is the code of this solution :
<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas'> <cas:authenticationSuccess> <cas:user>${fn:escapeXml(principal.id)}</cas:user> <c:if test="${not empty pgtIou}"> <cas:proxyGrantingTicket>${pgtIou}</cas:proxyGrantingTicket> </c:if> <c:if test="${fn:length(chainedAuthentications) > 0}"> <cas:proxies> <c:forEach var="proxy" items="${chainedAuthentications}" varStatus="loopStatus" begin="0" end="${fn:length(chainedAuthentications)}" step="1"> <cas:proxy>${fn:escapeXml(proxy.principal.id)}</cas:proxy> </c:forEach> </cas:proxies> </c:if> <c:if test="${fn:length(attributes) > 0}"> <cas:attributes> <c:forEach var="attr" items="${attributes}" varStatus="loopStatus" begin="0" end="${fn:length(attributes)}" step="1"> <c:forEach var="attrval" items="${attr.value}"> * <%-- if attribute memberof, replace current value with cleaned dn --%> <c:if test="${fn:escapeXml(attr.key) == 'memberof'}"> <c:set var="attrval" value="${fn:substringAfter(fn:substringBefore(fn:escapeXml(attrval), ','), 'CN=')}" /> </c:if> <%-- end of "if attribute memberof, replace current value with cleaned dn" --%>* <cas:${fn:escapeXml(attr.key)}>${fn:escapeXml(attrval)}</cas:${fn:escapeXml(attr.key)}> </c:forEach> </c:forEach> </cas:attributes> </c:if> Have a nice day, Steve. Le jeudi 26 novembre 2015 11:29:16 UTC+1, Fredrik Jönsson a écrit : > > I think you have to override LdaptivePersonAttributeDao with a custom > implementation. > > /Fredrik > > > 26 nov. 2015 kl. 11:08 skrev CyruS <[email protected] <javascript:>>: > > > > Hello, i'm looking for a solution to clean the DN of the memberOf > attribute. > > For example CN=group1,OU=xxx,DC=xxx,DC=xxx should be just "group1". > > With Cas 3.x, i used a personnal library. > > I saw some regex filter in CAS 4.x but not regex to replace or change > the value of an attribute. > > > > Is a native solution exist in the version 4? > > > > Many thanks for your help ;-) > > > > Steve. > > > > > > -- > > You received this message because you are subscribed to the Google > Groups "CAS Community" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to [email protected] <javascript:>. > > Visit this group at > http://groups.google.com/a/apereo.org/group/cas-user/. > > -- > You received this message because you are subscribed to the Google Groups > "CAS Community" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] <javascript:>. > Visit this group at http://groups.google.com/a/apereo.org/group/cas-user/. > > -- You received this message because you are subscribed to the Google Groups "CAS Community" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. Visit this group at http://groups.google.com/a/apereo.org/group/cas-user/.
