views:

43

answers:

1

We use Sharepoint 2007 as our internal portal. I'm currently developing a custom app (asp.net MVC2) and I've been asked to have the login process mimic Sharepoint, where a user is initially logged in using SSO but then can opt to logout and provide different credentials.

Any blogs/guides on how to do this?

UPDATE:

Thanks to reflector I was able to find a way to do this, but it doesn't totally work.

First off, I'm testing this on IIS running on my local Windows 7 machine.

I have setup the "LogOff" action to do the following:

            var current = System.Web.HttpContext.Current;
            var response = current.Response;
            object obj2 = current.Items["ResponseEnded"];
            if ((obj2 == null) || !((bool)obj2))
            {
                current.Items["ResponseEnded"] = true;
                response.StatusCode = 401;
                response.Clear();
                    response.Write("401 UNAUTHORIZED");
                response.End();
            }

This partially works. When I click "logOFf" I get prompted for credentials. Oddly enough, when debugging, I can see the method gets called twice (this is an MVC action).

But, even when providing valid credentials I still can't log back in. After the third try I get a 401 page.

My only thought here is somehow it's trying to use Kerberos to authenticate and since I don't have Kerberos setup on this machine it fails. But, when I first access the site from IE it just passes me IE credentials on (the SSO) and everything works fine, so I'm not sure why a second authentication fails.

A: 

asp.net membership provider is a great choice. There are a lot of options for authentication methods, based on your question though I think the .net membership provider would be your best bet. If you are using simply windows authentication, even sharepoint has its faults as IE will attempt to change the login back to the windows account user.

http://msdn.microsoft.com/en-us/library/yh26yfzy.aspx

brian brinley
Sharepoint doesn't appear to use a custom membership provider. It appears it just uses a 401 response to reauthenticate a user. However, when I try doing this I have no luck getting the user to authenticate correctly.
MBonig