I have implemented the “Sign in as different user” authentication functionality, using windows authentication, on our website. The functionality is same as SharePoint. I used explicit “un-authentication” by following code on our page which executes when user clicks on “Signin as different user” option:

protected void SignInAsDifferentUser_Click(object sender, EventArgs e)
    {
            Response.StatusCode = 401;
            Response.StatusDescription = "Unauthorized";
            Response.Redirect(“login.aspx”);
    }

It un-authenticates the page, when it reaches to the browser, and causes the browser to do authentication. It pops the authentication dialog box and user puts his/her credentials there and so authentication is done. If he cancels the authentication dialog box or do 3 consecutive failed authentication attempts, the functionality is written in my code to let him login as Guest.
I tested this functionality on IE 6/7/8 and on FireFox and it is working fine there. Issue raised when I tested it on Safari. It looked like Safari does not handle the 401 status code, as it does nothing and stay idle when this code reaches there. We don’t want the browser to stay idle, we want the browser to login the user as “Guest” if his/her authentication fails.
I am wondering what could be the right way of implementing the authentication functionality on Safari!

Recommended Answers

All 2 Replies

have u ever tried...

FormsAuthentication.Signout();
session.abandon();
session.clear();

if hope the things should work out for u..

I tried but this isn’t helpful because I am using integrated windows authentication, please provide some other solution.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.