Authorization question

M

Martin

I have a web site set up (intranet only - no internet access) in
which, when I receive a page request with an empty authorized user and
password, I issue a 401 response that pops up the userid/password
prompt on the user's browser. I would like to do some server-side
processing when they click OK on that - how can I detect that the
request I'm receiving is from that prompt? Is there something unique
about it that I can detect?
 
D

David Dorward

Martin said:
I have a web site set up (intranet only - no internet access) in
which, when I receive a page request with an empty authorized user and
password, I issue a 401 response that pops up the userid/password
prompt on the user's browser. I would like to do some server-side
processing when they click OK on that - how can I detect that the
request I'm receiving is from that prompt? Is there something unique
about it that I can detect?

No, you can only detect that someone is using basic authentication, how they
told their browser to send their credentials is impossible to detect.

How you get that information on the server rather depends on the language
and libraries you are working with, most come with some built in way to get
the username and password.
 
T

Toby Inkster

Martin said:
I issue a 401 response that pops up the userid/password prompt on the
user's browser. I would like to do some server-side processing when they
click OK on that - how can I detect that the request I'm receiving is
from that prompt?

It will include the "Authorization" HTTP header.

Really it sounds like you're re-inventing the wheel though.
http://httpd.apache.org/docs/howto/auth.html
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top