Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Logon as different user

Reply
Thread Tools

Logon as different user

 
 
=?Utf-8?B?Z292ZXI=?=
Guest
Posts: n/a
 
      05-22-2007
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.ActiveDirectoryMembershi pProvider,
System.Web, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</providers>
</membership>


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      05-22-2007

"gover" <> wrote in message
news:55589824-FDD4-4BCE-8F21-...
> 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.ActiveDirectoryMembershi pProvider,
> 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


 
Reply With Quote
 
 
 
 
Alexey Smirnov
Guest
Posts: n/a
 
      05-22-2007

"Alexey Smirnov" <> wrote in message
news:%...
>
> "gover" <> wrote in message
> news:55589824-FDD4-4BCE-8F21-...
>> 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?


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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Events: Logon vs Account Logon Jeroen Wijnands MCSA 0 03-06-2006 03:45 PM
Question Help: Logon vs Account Logon, Local Logon vs Authentication CJH Microsoft Certification 0 01-04-2006 04:03 PM
What is best practice: Combining anonymous logon with windows logon? Kjell Kristiansson ASP .Net Security 0 11-30-2005 12:53 PM
After logon as different user => Connection refused to host tamer kavlak Java 0 01-13-2005 10:30 AM
Problem: XP Home Logon Names Vanish - Cant Logon Graham Computer Support 0 01-24-2004 11:34 AM



Advertisments