Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - what is the difference between manually constructed NetworkCredentialand one from windowsidentity?

Reply
 
Old 08-12-2009   #1 (permalink)
DAXU


 
 

what is the difference between manually constructed NetworkCredentialand one from windowsidentity?

Hello,
I have a winform (client) and windows service (server),
At client side, when I construct a NetworkCredential manually by
providing username, password and domain, I can do this:

clientSide.AuthenticateAsClient(new NetworkCredential
("administrator","8ik,7UJM","jerry.test"),
spn.ToString(),
ProtectionLevel.EncryptAndSign, TokenImpersonationLevel.Delegation);

however, if I get the default credential from current windows identity
after impersnate the user:
clientSide.AuthenticateAsClient
(System.Net.CredentialCache.DefaultNetworkCredentials,
spn.ToString(),
ProtectionLevel.EncryptAndSign, TokenImpersonationLevel.Delegation);

It always fails and error message is:
A security requirement was not fulfilled during authentication.
Required: Delegation, negotiated: Impersonation.

So what is the difference between above calls? Except one is manually
constructed?

Many Thanks

Jerry

My System SpecsSystem Spec
Old 08-12-2009   #2 (permalink)
Gregory A. Beamer


 
 

Re: what is the difference between manually constructed NetworkCredential and one from windowsidentity?

DAXU <jerryxu7509@xxxxxx> wrote in news:41df4ea2-1544-4792-b934-
ad5609b38c62@xxxxxx:
Quote:

> Hello,
> I have a winform (client) and windows service (server),
> At client side, when I construct a NetworkCredential manually by
> providing username, password and domain, I can do this:
>
> clientSide.AuthenticateAsClient(new NetworkCredential
> ("administrator","8ik,7UJM","jerry.test"),
> spn.ToString(),
> ProtectionLevel.EncryptAndSign, TokenImpersonationLevel.Delegation);
>
> however, if I get the default credential from current windows identity
> after impersnate the user:
> clientSide.AuthenticateAsClient
> (System.Net.CredentialCache.DefaultNetworkCredentials,
> spn.ToString(),
> ProtectionLevel.EncryptAndSign, TokenImpersonationLevel.Delegation);
>
> It always fails and error message is:
> A security requirement was not fulfilled during authentication.
> Required: Delegation, negotiated: Impersonation.
>
> So what is the difference between above calls? Except one is manually
> constructed?
When you say "get the default credential from current windows identity
after impersonate the user" what do you mean exactly? Is this a web
service (ASMX or WCF) that is impersonating, another system, etc?

Depending on what is impersonating, you may have the security of the
configuration set up incorrectly. For example, web services have to be
configured to use Windows authentication to get the proper user token.

Regardless, check the actual user that is in the windows identity
credential by querying it after it is filled. If it is not the same,
that is the issue. If it is, check all of the properties and see if
there are any differences. Somewhere there has to be a difference you
can find and alleviate.


--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

Twitter: @gbworld
Blog: http://gregorybeamer.spaces.live.com

*******************************************
| Think outside the box! |
*******************************************
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Some solutions I have constructed (HTA HTML vbScript) VB Script
changing the IRQ manually Vista General
Should I install SP1 manually? Vista General
how to manually index? Vista General
help. How to remove rc2 manually PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46