# Apache auth with ruby and REMOTE\_USER variable

**URL:** <https://www.ruby-forum.com/t/apache-auth-with-ruby-and-remote-user-variable/128146>\
**Category:** Rails\
**Created:** [February 5, 2008, 11:54am UTC](https://www.ruby-forum.com/t/apache-auth-with-ruby-and-remote-user-variable/128146 "2008-02-05T11:54:56Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![KTU](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ecae2f/32.png) [@KTU](https://www.ruby-forum.com/u/KTU)\
**Post date:** [February 5, 2008, 11:54am UTC](https://www.ruby-forum.com/t/apache-auth-with-ruby-and-remote-user-variable/128146/1 "2008-02-05T11:54:56Z")

</div>

Hi

I am using apache to authenticate on ruby application. Now how I can  
print out value for REMOTE\_USER  
variable once authentication is done ?

---

<div class="post-metadata">

**Author:** ![KTU](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ecae2f/32.png) [@KTU](https://www.ruby-forum.com/u/KTU)\
**Post date:** [February 5, 2008, 7:23pm UTC](https://www.ruby-forum.com/t/apache-auth-with-ruby-and-remote-user-variable/128146/2 "2008-02-05T19:23:47Z")

</div>

On Feb 5, 10:53 am, KTU [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi
> 
> I am using apache to authenticate on ruby application. Now how I can  
> print out value for REMOTE\_USER  
> variable once authentication is done ?

I think request.headers() will give you an array of HTTP environment  
settings, REMOTE\_USER should be in that array.

See  
[http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html](http://api.rubyonrails.org/classes/ActionController/AbstractRequest.html)

Allan
