You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Andres Aguado <an...@gmail.com> on 2012/02/23 10:39:25 UTC

[users@httpd] Using requestheader to insert new header=environmentvariable_value

Hi all,

    Let me ask a short cuestion for help about my virtual host, that i
think it's not working

   Here is my virtual host:

   RequestHeader set NEW_HEADER env=%{ENV_VARIABLE}e
   ProxyPass /path http://destination_apphost
   ProxyPassReverse /path http://destination_apphost

   So, when i connect to www.myvhost.com from my computer, an
application will process my request and create an environment variable
(ENV_VARIABLE) with information that i want to send to destination
application host through http headers (NEW_HEADER).

Do you know if this configuration should work?, because i'm sniffing
traffic with WireShark and i'm not able to see NEW_HEADER anywhere

Thanks a lot for your time and help

Regards,
Andres

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Using requestheader to insert new header=environmentvariable_value

Posted by Andres Aguado <an...@gmail.com>.
Thanks for your responses.

Finally i followed tom's indications and with  new sentences the
header get null value, so i suppose that apache gets the env. value
before it's filled by credential application (PingF).

But, it seems that this app give apache information through http
headers, so finally here there is no problem.

I'd like to ask a question, if anyone knows. I've checked that
inserting header manually with firefox tool and sending request to
Websphere, logon to it works fine, but executing an user normal logon,
with single sign-on process it fails, and i don't know if there is
some particular aspect in apache configuration to works with
Websphere.

Anyone has any experience with this configuration?

Thanks for your help

Regards,
Andres

2012/2/23 Tom Evans <te...@googlemail.com>:
> On Thu, Feb 23, 2012 at 5:46 PM, Andres Aguado <an...@gmail.com> wrote:
>> Hi all, let me see.
>>
>> This is the sentence that i'm using now in httpd.conf, following
>> document http://httpd.apache.org/docs/current/mod/mod_headers.html
>>
>> RequestHeader set PF_AUTH_CORP_ID_NEW env=%{PF_AUTH_SUBJECT}e
>>
>> And this is what is can see in Wireshark
>>
>> PF_AUTH_CORP_ID_NEW: env=(null)
>> PF_AUTH_SUBJECT: a156168
>>
>
> Doesn't look right to me. Are you trying to set the header
> PF_AUTH_CORP_ID_NEW to the value of the PF_AUTH_SUBJECT environment
> variable?
>
> First off, headers shouldn't have underscores, and extension headers
> should start with X- (but this probably wouldn't stop it working).
> More importantly, you don't seem to be setting a value, but telling it
> to only set the header when the PF_AUTH_SUBJECT environment variable
> is set.
>
> I think you want this:
>
> RequestHeader set X-PF-Auth-Corp %{PF_AUTH_SUBJECT}e
>
> If you only want the header set when PF_AUTH_SUBJECT has a value:
>
> RequestHeader set X-PF-Auth-Corp %{PF_AUTH_SUBJECT}e env=%{PF_AUTH_SUBJECT}e
>
> Cheers
>
> Tom
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Using requestheader to insert new header=environmentvariable_value

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Feb 23, 2012 at 5:46 PM, Andres Aguado <an...@gmail.com> wrote:
> Hi all, let me see.
>
> This is the sentence that i'm using now in httpd.conf, following
> document http://httpd.apache.org/docs/current/mod/mod_headers.html
>
> RequestHeader set PF_AUTH_CORP_ID_NEW env=%{PF_AUTH_SUBJECT}e
>
> And this is what is can see in Wireshark
>
> PF_AUTH_CORP_ID_NEW: env=(null)
> PF_AUTH_SUBJECT: a156168
>

Doesn't look right to me. Are you trying to set the header
PF_AUTH_CORP_ID_NEW to the value of the PF_AUTH_SUBJECT environment
variable?

First off, headers shouldn't have underscores, and extension headers
should start with X- (but this probably wouldn't stop it working).
More importantly, you don't seem to be setting a value, but telling it
to only set the header when the PF_AUTH_SUBJECT environment variable
is set.

I think you want this:

RequestHeader set X-PF-Auth-Corp %{PF_AUTH_SUBJECT}e

If you only want the header set when PF_AUTH_SUBJECT has a value:

RequestHeader set X-PF-Auth-Corp %{PF_AUTH_SUBJECT}e env=%{PF_AUTH_SUBJECT}e

Cheers

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Using requestheader to insert new header=environmentvariable_value

Posted by Andres Aguado <an...@gmail.com>.
Hi all, let me see.

This is the sentence that i'm using now in httpd.conf, following
document http://httpd.apache.org/docs/current/mod/mod_headers.html

RequestHeader set PF_AUTH_CORP_ID_NEW env=%{PF_AUTH_SUBJECT}e

And this is what is can see in Wireshark

PF_AUTH_CORP_ID_NEW: env=(null)
PF_AUTH_SUBJECT: a156168

Do you know if this sentence is right, because assigned value is
unexpected for me, viewing value of environment variable that i'm
using

Thanks for your time

Regards,
Andres

2012/2/23 Andres Aguado <an...@gmail.com>:
> Thanks Erik. There is a PingFederate integration kit that will provide
> user information autenthication information through environment
> variables, it means, when a resource of application server is
> requested via http, an authentication process is triggered, and user
> id is provided through this PingFederate, which generate an
> environment variable with userid for apache, and we need to forward
> this userid embedded as http headers in http request sent from reverse
> proxy to application server.
>
> I'll try that mod_info
>
> thanks
> Andres
>
> 2012/2/23 Eric Covener <co...@gmail.com>:
>> On Thu, Feb 23, 2012 at 4:39 AM, Andres Aguado <an...@gmail.com> wrote:
>>> Hi all,
>>>
>>>    Let me ask a short cuestion for help about my virtual host, that i
>>> think it's not working
>>>
>>>   Here is my virtual host:
>>>
>>>   RequestHeader set NEW_HEADER env=%{ENV_VARIABLE}e
>>>   ProxyPass /path http://destination_apphost
>>>   ProxyPassReverse /path http://destination_apphost
>>>
>>>   So, when i connect to www.myvhost.com from my computer, an
>>> application will process my request and create an environment variable
>>> (ENV_VARIABLE) with information that i want to send to destination
>>> application host through http headers (NEW_HEADER).
>>>
>>> Do you know if this configuration should work?, because i'm sniffing
>>> traffic with WireShark and i'm not able to see NEW_HEADER anywhere
>>>
>>
>> What applicationsis running before the request is proxied?  The
>> operative part is to look at when mod_headers will try to read the
>> environment variable, which is probably before you'll set it.  You can
>> see when modules run in mod_info.
>>
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Using requestheader to insert new header=environmentvariable_value

Posted by Andres Aguado <an...@gmail.com>.
Thanks Erik. There is a PingFederate integration kit that will provide
user information autenthication information through environment
variables, it means, when a resource of application server is
requested via http, an authentication process is triggered, and user
id is provided through this PingFederate, which generate an
environment variable with userid for apache, and we need to forward
this userid embedded as http headers in http request sent from reverse
proxy to application server.

I'll try that mod_info

thanks
Andres

2012/2/23 Eric Covener <co...@gmail.com>:
> On Thu, Feb 23, 2012 at 4:39 AM, Andres Aguado <an...@gmail.com> wrote:
>> Hi all,
>>
>>    Let me ask a short cuestion for help about my virtual host, that i
>> think it's not working
>>
>>   Here is my virtual host:
>>
>>   RequestHeader set NEW_HEADER env=%{ENV_VARIABLE}e
>>   ProxyPass /path http://destination_apphost
>>   ProxyPassReverse /path http://destination_apphost
>>
>>   So, when i connect to www.myvhost.com from my computer, an
>> application will process my request and create an environment variable
>> (ENV_VARIABLE) with information that i want to send to destination
>> application host through http headers (NEW_HEADER).
>>
>> Do you know if this configuration should work?, because i'm sniffing
>> traffic with WireShark and i'm not able to see NEW_HEADER anywhere
>>
>
> What applicationsis running before the request is proxied?  The
> operative part is to look at when mod_headers will try to read the
> environment variable, which is probably before you'll set it.  You can
> see when modules run in mod_info.
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Using requestheader to insert new header=environmentvariable_value

Posted by Eric Covener <co...@gmail.com>.
On Thu, Feb 23, 2012 at 4:39 AM, Andres Aguado <an...@gmail.com> wrote:
> Hi all,
>
>    Let me ask a short cuestion for help about my virtual host, that i
> think it's not working
>
>   Here is my virtual host:
>
>   RequestHeader set NEW_HEADER env=%{ENV_VARIABLE}e
>   ProxyPass /path http://destination_apphost
>   ProxyPassReverse /path http://destination_apphost
>
>   So, when i connect to www.myvhost.com from my computer, an
> application will process my request and create an environment variable
> (ENV_VARIABLE) with information that i want to send to destination
> application host through http headers (NEW_HEADER).
>
> Do you know if this configuration should work?, because i'm sniffing
> traffic with WireShark and i'm not able to see NEW_HEADER anywhere
>

What applicationsis running before the request is proxied?  The
operative part is to look at when mod_headers will try to read the
environment variable, which is probably before you'll set it.  You can
see when modules run in mod_info.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org