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

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

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

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,153
    Spaliwal
    Mar 1, 2004
  2. caldera
    Replies:
    1
    Views:
    369
    David Jessee
    May 1, 2004
  3. dgk
    Replies:
    1
    Views:
    870
    Jason DeFontes
    May 14, 2004
  4. dw
    Replies:
    3
    Views:
    1,834
    Yunus Emre ALPĂ–ZEN [MCAD.NET]
    May 16, 2005
  5. Matthew Wilson

    urllib2 http authorization question

    Matthew Wilson, Dec 14, 2003, in forum: Python
    Replies:
    1
    Views:
    1,608
    Troels Therkelsen
    Dec 14, 2003
  6. hey
    Replies:
    3
    Views:
    251
    Joe Kaplan \(MVP - ADSI\)
    Mar 3, 2005
  7. SeanRW
    Replies:
    1
    Views:
    614
    Dominick Baier [DevelopMentor]
    May 25, 2006
  8. Replies:
    12
    Views:
    444
    Dominick Baier [DevelopMentor]
    Jul 7, 2006
Loading...