Steve,

We are successfully releasing attributes on version 5.0.5 with the CAS 2.0
protocol by overriding the casServiceValidationSuccess.html in our WAR
overlay. Do you have the file in the correct directory? It should be in
src/main/resources/templates/protocol/2.0.  We are using a custom namespace.

Here's what I am using:

<cas:serviceResponse xmlns:cas='http://www.yale.edu/tp/cas' xmlns:vcu='
http://login.vcu.edu/cas' th:inline="text">
    <cas:authenticationSuccess>
        <cas:user>[[${principal.id}]]</cas:user>
        <cas:proxyGrantingTicket
th:if="${pgtIou}">[[${pgtIou}]]</cas:proxyGrantingTicket>
        <cas:proxies th:if="${not #lists.isEmpty(chainedAuthentications)}">
            <cas:proxy th:each="proxy : ${chainedAuthentications}">[[${
proxy.principal.id}]]</cas:proxy>
        </cas:proxies>
        <vcu:attributes th:if="${not
#lists.isEmpty(assertion.primaryAuthentication.principal.attributes)}">

​  ​
<th:block th:each="attr :
${assertion.primaryAuthentication.principal.attributes}">

​  ​
<th:block th:switch="${#strings.startsWith(attr.value.class.name
,'java.util.Collection')}">

​  ​
<th:block th:case="${true}">

​    ​
<th:block th:each="av : ${attr.value}">
​              ​
<span th:utext="${'<vcu:' + attr.key + '>' + av + '</vcu:' + attr.key +
'>'}" th:remove="tag"></span>
​          ​
</th:block>

​  ​
</th:block>
        <th:block th:case="${false}">
        <span th:utext="${'<vcu:' + attr.key + '>' + attr.value + '</vcu:'
+ attr.key + '>'}" th:remove="tag"></span>
        </th:block>
        </th:block>
        </th:block>
</vcu:attributes>
    </cas:authenticationSuccess>
</cas:serviceResponse>

You could also try Robert's suggestion - I'm just relaying that the html
customization is working for us.

On Mon, May 15, 2017 at 2:02 AM, Robert Oschwald <robertoschw...@gmail.com>
wrote:

> You do not need to customize CasServiceValidationSuccess.html, if you
> just want to release attributes the same way as p3.
> For 5.0.5, you currently need to do the following things:
>
> 1. Overwrite the serviceValidateController bean definition, and wire in
> the cas3ServiceSuccessView, like so:
>
> @Bean
>     public ServiceValidateController serviceValidateController() {
>         final ServiceValidateController c = new
> ServiceValidateController();
>         c.setValidationSpecification(this.cas20WithoutProxyProtocolValid
> ationSpecification);
>         c.setSuccessView(cas3ServiceSuccessView());
>         c.setFailureView(cas2ServiceFailureView);
>         c.setProxyHandler(proxy20Handler);
>         c.setAuthenticationSystemSupport(authenticationSystemSupport);
>         c.setServicesManager(servicesManager);
>         c.setCentralAuthenticationService(centralAuthenticationService);
>         c.setArgumentExtractor(argumentExtractor);
>         c.setMultifactorTriggerSelectionStrategy(
> multifactorTriggerSelectionStrategy);
>         c.setAuthenticationContextValidator(authenticationContextValidator
> );
>         c.setJsonView(cas3ServiceJsonView());
>         c.setAuthnContextAttribute(casProperties.getAuthn().getMfa().
> getAuthenticationContextAttribute());
>         return c;
>     }
> }
>
> There is a current limitation up to 5.0.5, were it is not possible to
> overwrite these bean definitions. Therefore, you must copy the whole
> CasValidationConfiguration.java class from the CAS sources into your
> overlay projects org.apereo.cas.web.config package and make the change
> there.
> This will be fixed in 5.0.6, where you only need to define the bean
> definition above in your own config class, like
> OverwrittenServiceValidateConfiguration.
>
> 2. Set a property to use the p3 view for 2.0.
> Set the following property in cas.properties to use the p3 view for 2.0 as
> well:
>
> cas.view.cas2.success=protocol/3.0/casServiceValidationSuccess
>
>
>
> Hope that helps,
> Robert
>
> > Am 14.05.2017 um 22:23 schrieb Cyrus Grissom <cyrus.gris...@gmail.com>:
> >
> > Hello,
> >
> > Does anybody knows how to release attributes using the protocol 2.0 with
> CAS 5.0.5 ?
> >
> > I tried some customisations of "CasServiceValidationSuccess.html" file
> but without success.
> >
> > Many thanks for your help,
> >
> > Steve.
> >
> > --
> > - CAS gitter chatroom: https://gitter.im/apereo/cas
> > - CAS mailing list guidelines: https://apereo.github.io/cas/
> Mailing-Lists.html
> > - CAS documentation website: https://apereo.github.io/cas
> > - CAS project website: https://github.com/apereo/cas
> > ---
> > 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 cas-user+unsubscr...@apereo.org.
> > To view this discussion on the web visit https://groups.google.com/a/
> apereo.org/d/msgid/cas-user/c89672af-ef5e-4e98-892b-
> 93c1f8aaf091%40apereo.org.
>
> --
> - CAS gitter chatroom: https://gitter.im/apereo/cas
> - CAS mailing list guidelines: https://apereo.github.io/cas/
> Mailing-Lists.html
> - CAS documentation website: https://apereo.github.io/cas
> - CAS project website: https://github.com/apereo/cas
> ---
> 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 cas-user+unsubscr...@apereo.org.
> To view this discussion on the web visit https://groups.google.com/a/
> apereo.org/d/msgid/cas-user/4474DD13-8559-411E-A603-
> F9EB24F6AF94%40gmail.com.
>

-- 
- CAS gitter chatroom: https://gitter.im/apereo/cas
- CAS mailing list guidelines: https://apereo.github.io/cas/Mailing-Lists.html
- CAS documentation website: https://apereo.github.io/cas
- CAS project website: https://github.com/apereo/cas
--- 
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 cas-user+unsubscr...@apereo.org.
To view this discussion on the web visit 
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAN6MV5On47tbJa9aR2qVVCdXzTufz%2BNCeXZvrpvL13cgJG57nw%40mail.gmail.com.

Reply via email to