"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