You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Bo Berglund <bo...@telia.com> on 2007/01/08 22:35:16 UTC

[users@httpd] How to compose an URL so that login is done???

I want to add a link on my application's help menu where the user's
default browser will be opened on a customer page on our website.

The website is hosted on a provider running Apache server and I have
protected the customer pages using the .htpasswd file where user
logins adn password hashes are stored.

Now I would like our application to be able to launch the browser on
this webpage with the user/password already inside the URL passed to
the browser so that the login dialogue does not pop up and the user
gets immediately to the webpage.
This way the application will be "logged on" transparently to the
user.

Is it possible to do this (to compose such an URL text)???
Maybe something like this but some other syntax:
 www.mydomain.com/protectedpage.shtml?USER=myuser?PWD=mypwd

And please tell me if I am posting on the wrong NG for such a
question, it seemed the closest I could get to, but might be wrong
anyway...


Bo Berglund


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to compose an URL so that login is done???

Posted by Frank Hempel <li...@frankoni.net>.
Bo Berglund schrieb:
> I want to add a link on my application's help menu where the user's
> default browser will be opened on a customer page on our website.
> 
> The website is hosted on a provider running Apache server and I have
> protected the customer pages using the .htpasswd file where user
> logins adn password hashes are stored.
> 
> Now I would like our application to be able to launch the browser on
> this webpage with the user/password already inside the URL passed to
> the browser so that the login dialogue does not pop up and the user
> gets immediately to the webpage.
> This way the application will be "logged on" transparently to the
> user.
> 
> Is it possible to do this (to compose such an URL text)???
> Maybe something like this but some other syntax:
>  www.mydomain.com/protectedpage.shtml?USER=myuser?PWD=mypwd

What you want is that the request to 
www.mydomain.com/protectedpage.shtml has the authentication header set 
already.

So write a cgi-script, say 
www.mydomain.com/enter_protectedpage.cgi?USER=myuser?PWD=mypwd your 
application points to initally. This script redirects to your customers 
page for example via a http 302 and sets the authentication header for 
that page by the way. And of course it sould validate the 
USER/PWD-variables from the request.


cu, frank.


> 
> And please tell me if I am posting on the wrong NG for such a
> question, it seemed the closest I could get to, but might be wrong
> anyway...
> 
> 
> Bo Berglund
> 
> 
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 
> 
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: How to compose an URL so that login is done???

Posted by Bo Berglund <bo...@telia.com>.
On Tue, 9 Jan 2007 09:28:03 +0200, "Octavian Rasnita"
<or...@gmail.com> wrote:

>Well in that case you can simply use a link like
>
>http://www.site.com/program_name/username/password
>
>and put the program "program_name" to parse the URL, get the username and
>password, search the user in the file with users or a database and checks if
>the password is correct, and if it is, let the user see the page.
>The program should use cookie-based sessions, so the subsequent pages won't
>need to make the authentication again.
>
>Of course, the user has the rights to see the page, but when that user sees
>it, other users might be around and also see the username/password used.
>I think a better idea would be to make a POST request somehow and not a GET
>one, because in that case at least the username/password are not shown in
>the address bar.
>
>You can create a form that uses the POST method, with the hidden username
>and password fields set by default, and use a Javascript function that sends
>the form for making the login...
>In that case, the username and password will be sent in CGI style like 
>http://www.site.com/program_name?user=xxx&password=zzz.
>
>Octavian

Thanks,
I decided to go another route because I really do not want to bypass
the Apache security handling I am using already by instead having
logins handled by a program I have to maintain myself...
I have created a new password protected folder somewhere on our
website and there I will store the real user/password combinations. My
program will then itself get the proper file from the website using
its own secret user/password and parse out the data for the customer.

Then it will display a link to the customer pages along with the login
data for that customer. When he clicks the link the default browser
opens up and shows the login dialogue which he now has to fill in from
the display in the program page shown.

This way my program acts as a reminder for the customer and shows his
own login data but he has to do the login himself.



Bo Berglund


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: How to compose an URL so that login is done???

Posted by Octavian Rasnita <or...@gmail.com>.
Well in that case you can simply use a link like

http://www.site.com/program_name/username/password

and put the program "program_name" to parse the URL, get the username and
password, search the user in the file with users or a database and checks if
the password is correct, and if it is, let the user see the page.
The program should use cookie-based sessions, so the subsequent pages won't
need to make the authentication again.

Of course, the user has the rights to see the page, but when that user sees
it, other users might be around and also see the username/password used.
I think a better idea would be to make a POST request somehow and not a GET
one, because in that case at least the username/password are not shown in
the address bar.

You can create a form that uses the POST method, with the hidden username
and password fields set by default, and use a Javascript function that sends
the form for making the login...
In that case, the username and password will be sent in CGI style like 
http://www.site.com/program_name?user=xxx&password=zzz.

Octavian

----- Original Message ----- 
From: "Bo Berglund" <bo...@telia.com>
To: <us...@httpd.apache.org>
Sent: Tuesday, January 09, 2007 1:33 AM
Subject: [users@httpd] Re: How to compose an URL so that login is done???


> On Tue, 9 Jan 2007 00:11:13 +0200, "Octavian Rasnita"
> <or...@gmail.com> wrote:
>
>>Yes I think you can do this using something like:
>>
>>http://username:password@www.site.com/page.html
>>
>>But this method is not very secure, since anyone can take a look in the
>>html
>>code of the help file, and the username/password are also shown in the
>>address bar of the browser when the user opens it.
>>
>
> I tried that but unfortunately it just generated a "page cannot be
> displayed" error...
>
> "someting like" is not working, maybe there is another kind of
> variation on that???
> I know it is not secure, but that was not my concern because these
> users have the software that really should entitle them to access the
> site...
>
>
> Bo Berglund
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: How to compose an URL so that login is done???

Posted by Bo Berglund <bo...@telia.com>.
On Tue, 9 Jan 2007 00:11:13 +0200, "Octavian Rasnita"
<or...@gmail.com> wrote:

>Yes I think you can do this using something like:
>
>http://username:password@www.site.com/page.html
>
>But this method is not very secure, since anyone can take a look in the html 
>code of the help file, and the username/password are also shown in the 
>address bar of the browser when the user opens it.
>

I tried that but unfortunately it just generated a "page cannot be
displayed" error...

"someting like" is not working, maybe there is another kind of
variation on that???
I know it is not secure, but that was not my concern because these
users have the software that really should entitle them to access the
site...


Bo Berglund


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] How to compose an URL so that login is done???

Posted by Octavian Rasnita <or...@gmail.com>.
Yes I think you can do this using something like:

http://username:password@www.site.com/page.html

But this method is not very secure, since anyone can take a look in the html 
code of the help file, and the username/password are also shown in the 
address bar of the browser when the user opens it.

Octavian

----- Original Message ----- 
From: "Bo Berglund" <bo...@telia.com>
To: <us...@httpd.apache.org>
Sent: Monday, January 08, 2007 11:35 PM
Subject: [users@httpd] How to compose an URL so that login is done???


>I want to add a link on my application's help menu where the user's
> default browser will be opened on a customer page on our website.
>
> The website is hosted on a provider running Apache server and I have
> protected the customer pages using the .htpasswd file where user
> logins adn password hashes are stored.
>
> Now I would like our application to be able to launch the browser on
> this webpage with the user/password already inside the URL passed to
> the browser so that the login dialogue does not pop up and the user
> gets immediately to the webpage.
> This way the application will be "logged on" transparently to the
> user.
>
> Is it possible to do this (to compose such an URL text)???
> Maybe something like this but some other syntax:
> www.mydomain.com/protectedpage.shtml?USER=myuser?PWD=mypwd
>
> And please tell me if I am posting on the wrong NG for such a
> question, it seemed the closest I could get to, but might be wrong
> anyway...
>
>
> Bo Berglund
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
> 


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org