# How can access to AUTH\_USER?

**URL:** <https://www.ruby-forum.com/t/how-can-access-to-auth-user/105512>\
**Category:** Ruby\
**Created:** [May 30, 2007, 4:46pm UTC](https://www.ruby-forum.com/t/how-can-access-to-auth-user/105512 "2007-05-30T16:46:17Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![music](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@music](https://www.ruby-forum.com/u/music)\
**Post date:** [May 30, 2007, 4:46pm UTC](https://www.ruby-forum.com/t/how-can-access-to-auth-user/105512/1 "2007-05-30T16:46:17Z")

</div>

With php I can access to AUTH\_USER and REMOTE\_ADDR to know the  
authenticated user and the ip from which he come.  
With ruby there is available REMOTE\_ADDR but not AUTH\_USER.  
How can I access to the authenticated users?

---

<div class="post-metadata">

**Author:** ![music](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@music](https://www.ruby-forum.com/u/music)\
**Post date:** [May 30, 2007, 5:01pm UTC](https://www.ruby-forum.com/t/how-can-access-to-auth-user/105512/2 "2007-05-30T17:01:20Z")

</div>

On 30.05.2007 16:05, music wrote:

> With php I can access to AUTH\_USER and REMOTE\_ADDR to know the  
> authenticated user and the ip from which he come.  
> With ruby there is available REMOTE\_ADDR but not AUTH\_USER.  
> How can I access to the authenticated users?

Guessing that you are talking about CGI the value is likely accessible  
via ENV[‘AUTH\_USER’] _if_ the webserver you are using chose to put it  
there (i.e. if it supports authentication and the user actually  
authenticated). Just guessing of course…

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![music](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@music](https://www.ruby-forum.com/u/music)\
**Post date:** [May 31, 2007, 1:35pm UTC](https://www.ruby-forum.com/t/how-can-access-to-auth-user/105512/3 "2007-05-31T13:35:59Z")

</div>

Robert K. wrote:

> On 30.05.2007 16:05, music wrote:
> 
> > With php I can access to AUTH\_USER and REMOTE\_ADDR to know the  
> > authenticated user and the ip from which he come.  
> > With ruby there is available REMOTE\_ADDR but not AUTH\_USER.  
> > How can I access to the authenticated users?
> 
> Guessing that you are talking about CGI the value is likely accessible  
> via ENV[‘AUTH\_USER’] _if_ the webserver you are using chose to put it  
> there (i.e. if it supports authentication and the user actually  
> authenticated). Just guessing of course…

Yes I’m talking about cgi in ruby.  
I’ve used ENV[“AUTH\_USER”] but it has no value.  
In php the variable AUTH\_USER give me the authenticated user in ruby no.

---

<div class="post-metadata">

**Author:** ![music](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@music](https://www.ruby-forum.com/u/music)\
**Post date:** [May 31, 2007, 2:12pm UTC](https://www.ruby-forum.com/t/how-can-access-to-auth-user/105512/4 "2007-05-31T14:12:04Z")

</div>

On 2007-05-31 20:35:10 +0900 (Thu, May), music wrote:

> > authenticated). Just guessing of course…
> 
> Yes I’m talking about cgi in ruby.  
> I’ve used ENV[“AUTH\_USER”] but it has no value.  
> In php the variable AUTH\_USER give me the authenticated user in ruby no.

Look for HTTP\_AUTH\_USER, maybe.

---

<div class="post-metadata">

**Author:** ![music](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/7c8e57/32.png) [@music](https://www.ruby-forum.com/u/music)\
**Post date:** [May 31, 2007, 2:33pm UTC](https://www.ruby-forum.com/t/how-can-access-to-auth-user/105512/5 "2007-05-31T14:33:09Z")

</div>

On 5/31/07, music [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > authenticated). Just guessing of course…
> 
> Yes I’m talking about cgi in ruby.  
> I’ve used ENV[“AUTH\_USER”] but it has no value.  
> In php the variable AUTH\_USER give me the authenticated user in ruby no.

Either: have a look at all the ENV variables, and try the similar  
ones, as suggested in the previous mail, or check your webserver  
configuration if it sends the var at all.
