SharePoint Newbie
SharePoint Newbie

Reputation: 6082

How do I propogate Windows Identity without using delegation in WCF?

I need to propagate the Windows Identity of the current user across two service calls.

Service A (which runs under integrated authentication) calls Service B (which also runs under integrated authentication). I need to identify the user identity which was used to call Service A in Service B's code.

I know this is possible using delegation, by impersonating the User in Service A code and then call Service B from the impersonated code.

However, I only want to flow the identity and not impersonate the user. Is this possible without impersonation?

Upvotes: 0

Views: 1224

Answers (2)

Richard Blewett
Richard Blewett

Reputation: 6109

get the authenticated user using ServiceSecurityontext.Current.PrimaryIdentity.Name

Add this as either a header or a field in the downstream service request

Upvotes: 1

Ozzy
Ozzy

Reputation: 1730

I think you are looking for the impersonation level called "Identity". See this article for a description of different impersonation levels in WCF.

Upvotes: 0

Related Questions