fetching REMOTE_USER

Discussion in 'Perl Misc' started by JrK, Mar 4, 2005.

  1. JrK

    JrK Guest

    Hi,

    I want to get the value for users once authenticated by apache with the
    digest method in perl.
    The directory the webpage belongs to is password protected and requires a
    valid user
    created with htpasswd2. The webserver is apache2 with mod_perl-1.29

    The environment variable REMOTE_USER hasn't any value, so may there are any
    other
    recommendations on how to identify users easyly with perl ?


    TIA,
    Jrk.
    JrK, Mar 4, 2005
    #1
    1. Advertising

  2. JrK

    Brian Wakem Guest

    JrK wrote:

    > Hi,
    >
    > I want to get the value for users once authenticated by apache with the
    > digest method in perl.
    > The directory the webpage belongs to is password protected and requires a
    > valid user
    > created with htpasswd2. The webserver is apache2 with mod_perl-1.29
    >
    > The environment variable REMOTE_USER hasn't any value, so may there are
    > any other
    > recommendations on how to identify users easyly with perl ?
    >
    >
    > TIA,
    > Jrk.



    Try

    use CGI;
    my $query = new CGI;
    my $user = $query->remote_user();


    --
    Brian Wakem
    Brian Wakem, Mar 4, 2005
    #2
    1. Advertising

  3. JrK wrote:

    > created with htpasswd2. The webserver is apache2 with mod_perl-1.29
    >
    > The environment variable REMOTE_USER hasn't any value, so may there are
    > any other recommendations on how to identify users easyly with perl ?


    Since you're using mod_perl -

    my $user = Apache->request()->connection()->user();

    Or, as another posted mentioned, if you're using CGI.pm you could use its
    remote_user() method.

    sherm--

    --
    Cocoa programming in Perl: http://camelbones.sourceforge.net
    Hire me! My resume: http://www.dot-app.org
    Sherm Pendley, Mar 4, 2005
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Matt
    Replies:
    4
    Views:
    1,727
  2. Cas

    need remote_user servervariable

    Cas, Jul 19, 2004, in forum: ASP General
    Replies:
    4
    Views:
    187
  3. puregin

    reset remote_user servervariable

    puregin, Mar 3, 2005, in forum: ASP General
    Replies:
    0
    Views:
    105
    puregin
    Mar 3, 2005
  4. Hobie Audet
    Replies:
    1
    Views:
    105
    John Gordon
    Feb 20, 2014
  5. MRAB
    Replies:
    0
    Views:
    69
Loading...

Share This Page