Logon as different user

G

Guest

Hello,
I want to provide the ability to log on to a web application on our
intranet using different credentials like they do in Sharepoint 2007. When a
user hits the site, i want him automatically loggged in using his windows
credentials, but be able to swicth to different windows credentials from
within the web app. How do I go about doing this?

My current configuration is:
<authentication mode="Windows" />
<identity impersonate="true"/>

<membership defaultProvider="MyADMembershipProvider">
<providers>
<add connectionStringName="ADConnectionString"
connectionUsername="ust\rwg" enableSearchMethods="true"
connectionPassword="aruba7" name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider,
System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>
 
G

Guest

gover said:
Hello,
I want to provide the ability to log on to a web application on our
intranet using different credentials like they do in Sharepoint 2007.
When a
user hits the site, i want him automatically loggged in using his windows
credentials, but be able to swicth to different windows credentials from
within the web app. How do I go about doing this?

My current configuration is:
<authentication mode="Windows" />
<identity impersonate="true"/>

<membership defaultProvider="MyADMembershipProvider">
<providers>
<add connectionStringName="ADConnectionString"
connectionUsername="ust\rwg" enableSearchMethods="true"
connectionPassword="aruba7" name="MyADMembershipProvider"
type="System.Web.Security.ActiveDirectoryMembershipProvider,
System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>

Sharepoint doesn't impersonate the user. If impersonation is enabled,
ASP.NET executes under the authenticated user's user account

In your case, I think, you can impersonate a specific user in a code, as per
example:
http://support.microsoft.com/kb/306158
 
G

Guest

yet another thought about this. To force the logon prompt send to the
browser Response.Status = "401 Unauthorized". A 401 HTTP response code tells
the client that authentication information is required. You should also
specify what kind of authentication should be used. A special HTTP header
should be sent for that. For Windows Authentication it is "WWW-Authenticate
NTLM", where NTLM is a Windows-specific method.

Example:

If IsNothing(Session("NTLM")) Then

Session.Add("NTLM", "ok")
Response.Status = "401 Unauthorized"
Response.AddHeader("WWW-Authenticate", "NTLM")
Response.End()

Else

Session.Remove("NTLM")
Response.Redirect("/default.aspx")

End If

Put this code in the login.aspx and use this page to change the account.

Hope it works :)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,901
Latest member
Noble71S45

Latest Threads

Top