Results 1 to 5 of 5

Thread: Basic Authentication question

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Basic Authentication question

    We have an ASP site that uses Basic Authentication with SSL. When the user accesses the site the first thing they must do you enter a username and password. From then on they can continue browsing the site without have to authenticate again. The only time they will see the login request is if they close there current browser window and then return to the site. What I would like to do is have a log out option that would take the user to a non secure page and will not give them access again until they authenticate again.

    Basically what I’m asking is it possible to have IIS display the basic authentication dialog twice for the same site without having to close the browser first?

  2. #2
    Evil Genius alex_read's Avatar
    Join Date
    May 2000
    Location
    Espoo, Finland
    Posts
    5,538

    Re: Basic Authentication question

    Not using that level of IIS authentication, no.

    What you would need to do is implement a form of forms authentication and your own login page, storing a UserID (for example) at logon within a session variable, then clear this session variable upon the logout link being clicked. Finally implementing a validation check upon the loading of each restricted page in order to check a valid credential (i.e. UserID) session variable was set, or otherwise redirecting the user to the login page once again.

    Please rate this post if it was useful for you!
    Please try to search before creating a new post,
    Please format code using [ code ][ /code ], and
    Post sample code, error details & problem details

  3. #3
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Basic Authentication question

    Check the session variable and throw an HTTP 401 if the session variable doesn't exist so that they are prompted again.

  4. #4

    Thread Starter
    PowerPoster
    Join Date
    Jun 2001
    Location
    Trafalgar, IN
    Posts
    4,141

    Re: Basic Authentication question

    How do you throw an HTTP 401?

    I have tried err.Raise 401 and that just produces an "Unknown runtime error"

  5. #5
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: Basic Authentication question

    It should be Response.Status to set the status code.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width