Just so I understand, you are setting headers on the validation
response to mod_auth_cas in your CAS server and expect the headers to
show up?

They will not show up.

You will need add those headers to the attributes sent back in the
validation response for them to be available as headers in you PHP
script.

On 29 September 2018 at 09:04, Ramakrishna G <ramakris...@teligenz.in> wrote:
> Hello all,
>
> I have custom authentication handler in CAS where I set headers post
> successful validation of user. This is my code snippet.
>
> if(isValidUser(credentials.getUsername(), credentials.getPassword()))
>         {
>         HttpServletResponse httpResponse = (HttpServletResponse)
> ExternalContextHolder.getExternalContext().getNativeResponse();
>
> httpResponse.addHeader("CAS-Username",credentials.getUsername());
>             httpResponse.addHeader("CAS-Status",status);
>             httpResponse.addHeader("CAS-LastLoginTime",lastlogin);
>
>         final String username = credentials.getUsername();
>         AuthenticationHandlerExecutionResult result =
> createHandlerResult(credentials,
> this.principalFactory.createPrincipal(username));
>         return result;
>         }
>
> And I am using Mod_auth_cas CAS client. Now my problem is I am unable to
> receive the headers set in CAS.
>
> My Mod_auth_cas config is:
>
> cas.conf
> LoadModule auth_cas_module modules/mod_auth_cas.so
> CASCertificatePath /etc/pki/tls/certs/cas.com.crt
> CASCookiePath /var/cache/mod_auth_cas/
> CASLoginURL  https://localhost:8443/cas/login
> CASValidateURL  https://localhost:8443/cas/serviceValidate
> CASRootProxiedAs https://xxx.xxx.com
> CASCookieDomain cas.com
> CASSSOEnabled On
> CASIdleTimeout 1500
> CASAttributePrefix "CAS-"
>
> ssl.conf
>  <Location />
>                 AllowOverride
>                 AuthType CAS
>                 require valid-user
>                 ProxyPass http://localhost/index.php
>                 ProxyPassReverse http://localhost/index.php
>                 CASAuthNHeader user-info
>          </Location>
>
> And in my index.php file I am printing all the headers received. The problem
> is I always only receive HTTP_USER_INFO :: cas.
>  I want to receive all the headers set in CAS. Am i missing something? Can
> someone help me in getting all the headers.
>
> Thanks
> Ramakrishna G
> +91 8792114542
>
>
> --
> - Website: https://apereo.github.io/cas
> - Gitter Chatroom: https://gitter.im/apereo/cas
> - List Guidelines: https://goo.gl/1VRrw7
> - Contributions: https://goo.gl/mh7qDG
> ---
> 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/CAGST5P84WfKGrnaBKsy%3DANvk2DQ-tC8VNQGB8ZGhk5N%2BVu0bGQ%40mail.gmail.com.

-- 
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
--- 
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/CAAgu-wC1SZd6w9P_AupPcPAu1AdG69v-2nnF_MfFMbGbc6xT%2Bg%40mail.gmail.com.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature

Reply via email to