Re: Passing windows credentials from server to server.

From: Andrea D'Onofrio [MSFT] (andreado_at_online.microsoft.com)
Date: 12/30/03


Date: Tue, 30 Dec 2003 11:57:33 +0100

Hi,
can you set on server B windows authentication? If yes, you can easily solve
your problem by turning on impersonation in server A's web.config.

HtH,
Andrea

"Wade Wegner" <wwegner23@hotmail.com> wrote in message
news:OEOFuaKzDHA.1196@TK2MSFTNGP12.phx.gbl...
> Hello,
>
> I have been desperately trying to programmatically authenticate a windows
> user, create their credentials, and then redirect them to a different
server
> while passing the credentials at the same time so that they don't have to
> login again.
>
> Specifically, I have two webservers in the same domain. When I have a
user
> go to Webserver A (which uses basic authentication) I programmatically
> create either a user credential or impersonate a user context (for now
it's
> hardcoded, but in the future it would be entered in forms). Then, I want
to
> let that user access a page on Webserver B (which uses basic
> authentication), but I don't want them to have to login again -- rather, I
> want to use the user context that I programmatically created on Webserver
A.
>
> For instance, here is an example of the code I use to create the user
> credentials:
>
> Dim strURI = "http://www.whatever.com"
> Dim myCred As New NetworkCredential("userid", "password", "domain")
> Dim myURI As New Uri(strURI)
> Dim myCache As New CredentialCache
> myCache.Add(myURI, "Basic", myCred)
>
> From this, I have attempted to use WebRequests and WebResponses to somehow
> allow me to direct the browser to a different page, and use the credential
I
> have generated. The most I can do, however, is create the request and
> receive the response:
>
> Dim myWebRequest As System.Net.WebRequest =
> System.Net.WebRequest.Create(strURI)
> myWebRequest.Credentials = myCache
> Dim myWebResponse As WebResponse = myWebRequest.GetResponse()
>
> If only I could use the response.redirect method, and somehow pass the
> credentials with the redirection (like you can with the webrequest), it
> could work!
>
> I have also attempted to use the LogonUser API (from the advapi32.dll),
and
> impersonate a user based on the proper logon information -- this works,
and
> I'm able to successfully impersonate the user, but again, I don't know how
> to pass along the user context to a different page.
>
> I know that many people will say "just use form based authentication,"
but
> this will not work for me, as I want this to work with tools like Outlook
> Web Access, which requires windows authentication.
>
> Any help would be greatly appreciated. Thank you!!
>
> Wade
>
>
>



Relevant Pages

  • Re: Passing windows credentials from server to server.
    ... FYI - below I did specify that Server B uses windows authentication. ... >> while passing the credentials at the same time so that they don't have ... >> If only I could use the response.redirect method, and somehow pass the ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Impersonation and webproxy credentials
    ... worked with ISA servers, but these are my 2 cents. ... when you specify "identity impersonate" with userName ... credentials info, these credentials should be passed to the outbound calls. ... So if you had a SQL server somewhere, you would be able to connect to it ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: run commands using credentials of different domains
    ... I'm trying to establish a connection to an SQL 2005 server using different ... so I have to impersonate a different user. ... I've confirmed with absolute certainty that the credentials that I am ... I assume the error comes from trying to authenticate credentials that my ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: winnt vs. sql auth
    ... The biggest benefit of using Windows Authentication is the security of the ... account access, then somewhere that account information must be stored. ... the storage of this information is on the very server that is at ... login credentials are transmitted over the network in cleartext. ...
    (microsoft.public.sqlserver.server)
  • Re: run commands using credentials of different domains
    ... "Joe Kaplan" wrote: ... I'm trying to establish a connection to an SQL 2005 server using different ... so I have to impersonate a different user. ... I've confirmed with absolute certainty that the credentials that I am ...
    (microsoft.public.dotnet.framework.aspnet.security)