Re: [cas-user] Mod_Auth_Cas Headers
On 1 October 2018 at 14:02, Ramakrishna G wrote: > David, > > Can you pls share code snippet or link for setting headers to response > attribute. The wording was confusing in my last email, but we are just talking about attribute release here. You should review the documentation for your CAS server. -- - 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-wC0FrVv26d2fPx5snc30y7HrDiojA0hd3h9s4xrthfhBQ%40mail.gmail.com. smime.p7s Description: S/MIME Cryptographic Signature
Re: [cas-user] Mod_Auth_Cas Headers
David, Can you pls share code snippet or link for setting headers to response attribute. Thanks Ramakrishna > On 01-Oct-2018, at 10:01 PM, David Hawes wrote: > > 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 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 >> >>AllowOverride >>AuthType CAS >>require valid-user >>ProxyPass http://localhost/index.php >>ProxyPassReverse http://localhost/index.php >>CASAuthNHeader user-info >> >> >> 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. -- - 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/4A4BB4FE-F8C5-4784-A85F-96200E25909B%40teligenz.in.
Re: [cas-user] Mod_Auth_Cas Headers
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 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 > > AllowOverride > AuthType CAS > require valid-user > ProxyPass http://localhost/index.php > ProxyPassReverse http://localhost/index.php > CASAuthNHeader user-info > > > 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. smime.p7s Description: S/MIME Cryptographic Signature
[cas-user] Mod_Auth_Cas Headers
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* AllowOverride AuthType CAS require valid-user ProxyPass http://localhost/index.php ProxyPassReverse http://localhost/index.php CASAuthNHeader user-info 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.