473,385 Members | 1,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Logon as different user

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>
May 22 '07 #1
2 3181

"gover" <go***@discussions.microsoft.comwrote in message
news:55**********************************@microsof t.com...
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
May 22 '07 #2

"Alexey Smirnov" <al************@gmail.comwrote in message
news:%2****************@TK2MSFTNGP04.phx.gbl...
>
"gover" <go***@discussions.microsoft.comwrote in message
news:55**********************************@microsof t.com...
>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 :-)
May 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: newbie | last post by:
Hi there I use Access2002. I have designed a database in a router connected workgroup envirament. I put it into my shared doc folder so everybody in the workgroup have access to it. I want to have...
10
by: Fabrizio | last post by:
(Sorry for the crosspost, but I really don't know which is the right newsgroup!) Hi all, I try to change the password to a user that as to change the password at first logon: try {
6
by: Alixx Skevington | last post by:
OK why does the following code work in a Windows form with a crystal report viewer but not in a webform. I get the usual CrystalReports.EngineLogONException logon Failed when this is called in...
2
by: J-T | last post by:
Hi All, We have an asp.net application on a windows 2003 server which is part of a domain controller which my worksatis is too. We have impersonated in our applciation with a fixed identity...
3
by: Hugh O | last post by:
Hi, I have been trying to load a Crystal Report newly created via VS.Net 2003. I am using a simply ASP form with only the Crystal Report Viewer. The sample report results display in the...
9
by: Tim Baley | last post by:
I recently created some intranet web sevices to expose stored procedures on our SQL Servers (SQL2k). The stored procedures include an audit trail with user/login identification, so the web...
1
by: Kjell Kristiansson | last post by:
In developing a solution I ran into a problem where I have found no acceptable solution. The problem is combining users with anonymous login and users logged in to a domain in the same .aspx...
1
by: Fred | last post by:
If I select Anonymous in IIS under Security for my application and provide a user other than IUSR which has permissions to create folders, etc. on another server, I am able to create the folder I...
0
by: robpimentel | last post by:
Hi, I've been using DB2 for about 1 week, so please bear with me. DB2 Connect Enterprise Edition v8.1 FixPack 5 Windows Server 2003 Standard Edition SP1 Here is an error that continues to...
18
by: Arthur | last post by:
Hi All, I would like to get the name of the user given their networkID, is this something Active Directory would be useful for?(For intranet users) If so, can you please point me to some sample...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.