I believe headers are changed into environment variables much later: you’ll
need to use a different syntax to get at thems.
I’d guess “{CAS_SURNAME}i” from my memory of how one uses headers in log
formats, but check the mod_rewrite docs at httpd.apache.org.
Also, I’d recommend being consistent with your case, even if the specific
protocol is case insensitive. You set MyHeader but use MYHEADER. I say
this because I got confused, not because you were wrong. ;-)
On Fri, Oct 29, 2021 at 3:59 PM Brian Keifer <[email protected]> wrote:
> I've got an application that has one field for "Full Name" but our
> environment only releases GivenName and Surname. I thought it would be
> trivial to use something like mod_headers or mod_rewrite to concatenate
> these two fields together, but it's proving more of a challenge than I
> expected.
>
> I used a PHP script in my application's directory to verify that the
> variables were set by calling print_r($_SERVER); and get, among others, the
> following variables displayed:
>
> [HTTP_CAS_SURNAME] => Keifer
> [HTTP_CAS_GIVENNAME] => Brian
>
> If I try to combine these using:
>
> RequestHeader set MyHeader "%{HTTP_CAS_GIVENNAME}e %{HTTP_CAS_SURNAME}e"
>
> I end up with this:
>
> [HTTP_MYHEADER] => (null) (null)
>
> I've tried this using mod_rewrite as well. I used REMOTE_ADDR just to
> prove to myself that I could at least access *some* variables.
>
> RewriteRule .* - [E=GIVENNAME:%{LA-U:REMOTE_ADDR}]
> RewriteRule .* - [E=SURNAME:%{LA-U:HTTP_CAS_SURNAME}]
>
> produces this:
>
> [SURNAME] =>
> [GIVENNAME] => 10.2.12.142
>
> Interestingly, using mod_headers in a similar fashion with one CAS
> variable and REMOTE_ADDR behaves differently. This:
>
> RequestHeader set GIVENNAME1 "%{HTTP_CAS_GIVENNAME}e"
> RequestHeader set SURNAME1 "%{REMOTE_ADDR}e"
>
> Produces:
>
> [HTTP_SURNAME1] => (null)
> [HTTP_GIVENNAME1] => (null)
>
> Can anyone shed some light on this? Why can't I get at these variables?
>
> Thanks,
>
> -Brian
>
> --
> - 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/a/apereo.org/d/msgid/cas-user/1483014e-e004-4c68-bf22-46ec44fa9070n%40apereo.org
> <https://groups.google.com/a/apereo.org/d/msgid/cas-user/1483014e-e004-4c68-bf22-46ec44fa9070n%40apereo.org?utm_medium=email&utm_source=footer>
> .
>
--
Jim Toth
[email protected]
Lead Engineer, Middleware
Technology Services
(804) 827-1227
--
- 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CAFjekK6ZxvUs%3D9ige%2B%2BbF-Vyak02TQpWdo%3DDuj11871qP_EoKQ%40mail.gmail.com.