Authorization question

Discussion in 'HTML' started by Martin, May 12, 2005.

  1. Martin

    Martin Guest

    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?
     
    Martin, May 12, 2005
    #1
    1. Advertising

  2. Martin wrote:

    > 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.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
     
    David Dorward, May 12, 2005
    #2
    1. Advertising

  3. Martin

    Toby Inkster Guest

    Martin wrote:

    > 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

    --
    Toby A Inkster BSc (Hons) ARCS
    Contact Me ~ http://tobyinkster.co.uk/contact
     
    Toby Inkster, May 12, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. will
    Replies:
    1
    Views:
    1,033
    Spaliwal
    Mar 1, 2004
  2. caldera
    Replies:
    1
    Views:
    291
    David Jessee
    May 1, 2004
  3. dgk
    Replies:
    1
    Views:
    836
    Jason DeFontes
    May 14, 2004
  4. dw
    Replies:
    3
    Views:
    1,703
    Yunus Emre ALPĂ–ZEN [MCAD.NET]
    May 16, 2005
  5. SeanRW
    Replies:
    1
    Views:
    393
    Dominick Baier [DevelopMentor]
    May 25, 2006
Loading...

Share This Page