Return-Path: Delivered-To: apmail-perl-modperl-archive@www.apache.org Received: (qmail 74341 invoked from network); 19 Jun 2008 12:53:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 19 Jun 2008 12:53:53 -0000 Received: (qmail 2465 invoked by uid 500); 19 Jun 2008 12:53:49 -0000 Delivered-To: apmail-perl-modperl-archive@perl.apache.org Received: (qmail 2447 invoked by uid 500); 19 Jun 2008 12:53:48 -0000 Mailing-List: contact modperl-help@perl.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list modperl@perl.apache.org Received: (qmail 2436 invoked by uid 99); 19 Jun 2008 12:53:48 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2008 05:53:48 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of titetluc@gmail.com designates 209.85.132.249 as permitted sender) Received: from [209.85.132.249] (HELO an-out-0708.google.com) (209.85.132.249) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 19 Jun 2008 12:52:59 +0000 Received: by an-out-0708.google.com with SMTP id c24so187528ana.57 for ; Thu, 19 Jun 2008 05:53:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=L6uxXnJxy14bZj3iL9LuhWm+CZxtNsjNg88WPadpbzQ=; b=gqqTnb20WLmB6Y+UNL14fVsRf4zVllxi66klc6IcM3MOqKS0N4VD0cPo/WZncV7kZL +J3lv/PVOo4iEM5eETLK8lNsnS+gi3DKL9kjhSdUvrn7cDo3/vlhOjcSLa5Wj0KpiVxv Dwkx7Yc3Rsqo7bEcFXwVVwB8u83Kpc7Wb+Gng= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=PuXE/lqnvSIwnFY/5QZMDxTqMjRWtkf30ybZvmZC/sB2dFDMVubvKDcUWtj+1JSmHG 6QhZguyT6IWjF1kuJrtgnEc9BmRoPpul+lHm3mocfUCpyhRgrPEVPxsVyX4VrgbxmyE5 cRxqVlnUmPRfcd0g8RYRFlCLFXaZVkvYXBbww= Received: by 10.100.128.20 with SMTP id a20mr3143914and.153.1213879997115; Thu, 19 Jun 2008 05:53:17 -0700 (PDT) Received: by 10.100.123.3 with HTTP; Thu, 19 Jun 2008 05:53:17 -0700 (PDT) Message-ID: <9b0e769d0806190553u61d5a9dexcb81861f48afb554@mail.gmail.com> Date: Thu, 19 Jun 2008 14:53:17 +0200 From: "titetluc titetluc" To: modperl@perl.apache.org Subject: [MP2]: setting group for a request (require group ...) MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_7021_21027177.1213879997090" X-Virus-Checked: Checked by ClamAV on apache.org ------=_Part_7021_21027177.1213879997090 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello all, I am writing a mod_perl authentication module (My::Auth). This module sets the user using the Apache2::RequestRec::user method. package My::Auth; sub { .... $r->user('getting the user in my module internal structure'); return OK; } In the Apache configuration file, I can use the configuration PerlAuthHandler My::Auth Require user user1 .... I would like to use my module in another configuration where group is checked PerlAuthHandler My::Auth Require group group1 .... I can not find any mod_perl API method (Apache2::RequestRec::group ?) to set the group. I only found Apache2::RequestRec::require method, but this method only read the require configuration. One way to solve the problem is the modify the My::Auth::handler method : package My::Auth; sub { .... $r->user('getting the user in my module internal structure'); my $requires = $r->requires; # here the code to verify authorization return OK; } but I think this is a workaround: . My::Auth::handler is an AUTHENTICATION handler . the code to verify the AUTHORIZATION should have to be executed by the httpd core. How can I manage authorization in this case ? Thanks ------=_Part_7021_21027177.1213879997090 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Hello all,

I am writing a mod_perl authentication module (My::Auth).

This module sets the user using the Apache2::RequestRec::user method.

package My::Auth;
sub {
 ....
 $r->user('getting the user in my module internal structure');
 return OK;
}

In the Apache configuration file, I can use the configuration

<Location /test_user>
PerlAuthHandler  My::Auth
Require user user1
....
</Location>

I would like to use my module in another configuration where group is checked

<Location /test_group>
PerlAuthHandler  My::Auth
Require group group1
....
</Location>

I can not find any mod_perl API method (Apache2::RequestRec::group ?) to set the group. I only found Apache2::RequestRec::require method, but this method only read the require configuration.

One way to solve the problem is the modify the My::Auth::handler method :

package My::Auth;
sub {
 ....
 $r->user('getting the user in my module internal structure');
 my $requires = $r->requires;
 
 # here the code to verify authorization

 return OK;
}

but I think this is a workaround:
 . My::Auth::handler is an AUTHENTICATION handler
 . the code to verify the AUTHORIZATION should have to be executed by the httpd core.

How can I manage authorization in this case ?

Thanks



------=_Part_7021_21027177.1213879997090--