LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 04-02-2007, 06:02 PM   #1
ClarkWGriswold
LQ Newbie
 
Registered: Apr 2007
Posts: 2

Rep: Reputation: 0
Use Apache Basic Authentication with user-created form


I'm working on using mod_authz_ldap to do authentication for my application and I'm trying to avoid using the standard username/password box that Apache presents when trying to access a restricted page.

Is it possible to prevent the Apache login box from popping up and using a form within my html to post to *something* that will pass the login values to apache to perform the Basic Authentication?

I've read through the documentation and I don't recall seeing anything that might work. I'm not sure if this is even possible.

Thanks!!
 
Old 04-03-2007, 04:11 AM   #2
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,419

Rep: Reputation: 99
I'm not completely sure (90 % only) but i think that you have to manage a registered session with a script language like perl, php and cookies if you want a custom login. The basic-auth mechanism cannot be emulated by some html code.
 
Old 04-03-2007, 10:40 AM   #3
ClarkWGriswold
LQ Newbie
 
Registered: Apr 2007
Posts: 2

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by j-ray
I'm not completely sure (90 % only) but i think that you have to manage a registered session with a script language like perl, php and cookies if you want a custom login. The basic-auth mechanism cannot be emulated by some html code.

That's kind of what I figured. I wasn't sure if it was even possible. It's been a while, but I thought I may have done something like this in the past. Something like setting PHP_AUTH_USER (in PHP: $_SERVER['AUTH_PHP_USER']) equal to the user name collected from the login script and *tricking* Apache into seeing this value set when accessing a protected realm, however, I don't think that would actually work. (works in my head, just not in reality )

Anyone else ever try something like this?
 
Old 01-09-2008, 03:51 PM   #4
wjsams
LQ Newbie
 
Registered: Jan 2008
Posts: 1

Rep: Reputation: 0
I think this might help.

This shows you how to read the .htpasswd file from PHP.

Sorry, I had to put spaces because I'm new here.

http : // koivi.com / php-http-auth /

This is used with basic authentication.

Last edited by wjsams; 01-09-2008 at 03:53 PM. Reason: Thought it might not be exactly helpful after the fact, but it's close and very useful anyway.
 
  


Reply

Tags
apache, authentication, basic, login, php


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache Basic Authentication not working in Gentoo libregeek Linux - Networking 1 03-14-2006 09:16 AM
[SOLVED] Apache basic authentication gypsy_rabbi Linux - Security 3 01-17-2005 08:09 PM
apache .htaccess basic authentication not working quite right kleptophobiac Linux - Software 3 01-10-2004 02:43 PM
Authentication by Submit Form in Apache??????? ruiseixas Linux - Security 1 11-22-2003 11:02 PM
apache 1.3.27, basic authentication problem Robert0380 Linux - Software 6 06-08-2003 09:51 PM


All times are GMT -5. The time now is 07:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration