Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Apache: Users

How to collect username from http header ?

 

 

Apache users RSS feed   Index | Next | Previous | View Threaded


joydeep at infoservices

Jun 20, 2012, 5:14 AM

Post #1 of 4 (228 views)
Permalink
How to collect username from http header ?

Dear list,

I have a git setup where user can authenticate via https based on htpasswd authentication.
I need some more fine tuning ; hence I like to know the username for the specific connection.
Say user1 has authenticated successfully, and I like to compare his ACL based on another file.
How can I know the connection using username as user1 ?
Could anyone give me any clue how to do that ?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


joydeep at infoservices

Jun 20, 2012, 5:24 AM

Post #2 of 4 (219 views)
Permalink
Re: How to collect username from http header ? [In reply to]

On Wed, 20 Jun 2012 17:44:04 +0530
"J. Bakshi" <joydeep [at] infoservices> wrote:

> Dear list,
>
> I have a git setup where user can authenticate via https based on htpasswd authentication.
> I need some more fine tuning ; hence I like to know the username for the specific connection.
> Say user1 has authenticated successfully, and I like to compare his ACL based on another file.
> How can I know the connection using username as user1 ?
> Could anyone give me any clue how to do that ?
>
> Thanks

IS it "RequestHeader set X-Auth-User" ?

If yes, then what module should I install ?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


jeff.dyke at gmail

Jun 20, 2012, 5:39 AM

Post #3 of 4 (222 views)
Permalink
Re: How to collect username from http header ? [In reply to]

On Wed, Jun 20, 2012 at 8:24 AM, J. Bakshi <joydeep [at] infoservices> wrote:
> On Wed, 20 Jun 2012 17:44:04 +0530
> "J. Bakshi" <joydeep [at] infoservices> wrote:
>
>> Dear list,
>>
>> I have a git setup where user can authenticate via https based on htpasswd authentication.
>> I need some more fine tuning ; hence I like to know the username for the specific connection.
>> Say user1 has authenticated successfully, and I like to compare his ACL based on another file.
>> How can I know the connection using username as user1 ?
>> Could anyone give me any clue how to do that ?
>>
>> Thanks
>
> IS it "RequestHeader set X-Auth-User"  ?
>
> If yes, then what module should I install ?
>
> Thanks
if they are authenticated via htpasswd via BasicAuth or similar, it
should be available to you as "REMOTE_USER" with no additional modules
installed. Though accessing it will be different for different
languages.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe [at] httpd
> For additional commands, e-mail: users-help [at] httpd
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd


joydeep at infoservices

Jun 20, 2012, 5:50 AM

Post #4 of 4 (221 views)
Permalink
Re: How to collect username from http header ? [In reply to]

On Wed, 20 Jun 2012 08:39:13 -0400
Jeff Dyke <jeff.dyke [at] gmail> wrote:

> On Wed, Jun 20, 2012 at 8:24 AM, J. Bakshi <joydeep [at] infoservices> wrote:
> > On Wed, 20 Jun 2012 17:44:04 +0530
> > "J. Bakshi" <joydeep [at] infoservices> wrote:
> >
> >> Dear list,
> >>
> >> I have a git setup where user can authenticate via https based on htpasswd authentication.
> >> I need some more fine tuning ; hence I like to know the username for the specific connection.
> >> Say user1 has authenticated successfully, and I like to compare his ACL based on another file.
> >> How can I know the connection using username as user1 ?
> >> Could anyone give me any clue how to do that ?
> >>
> >> Thanks
> >
> > IS it "RequestHeader set X-Auth-User"  ?
> >
> > If yes, then what module should I install ?
> >
> > Thanks
> if they are authenticated via htpasswd via BasicAuth or similar, it
> should be available to you as "REMOTE_USER" with no additional modules
> installed. Though accessing it will be different for different
> languages.

Thanks for the clue. Here I'm using bash script. Shall ${REMOTE_USER} sufficient ?

Once more idea is running in my head. Why not check refs/heads/master against a
htpassword file. The present config for git push is

[..]

<LocationMatch "/git/.*/git-receive-pack$">
AuthType Basic
# Message to give to the committer
AuthName "Write access requires a password"
# File listing users with write (commit) access
AuthUserFile /home/git/pushACL
Require valid-user
</LocationMatch>

[..]

As you can see, it checks all push attempt against a htpassword file. Can I add
one more check here to check the refs/heads/master push attempt against a file too ?

Thanks

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe [at] httpd
For additional commands, e-mail: users-help [at] httpd

Apache users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.