Getting an authenticated client identity in a service operation
WCF provides various built-in authentication methods either at the transport layer or at the message layer. The client consumer can use a WCF service proxy or ChannelFactory
to supply certain client credentials to the service. The following MSDN reference lists all the built-in credential types supported by WCF:
Selecting a Credential Type
After the service request passes authentication, a valid identity will be associated with each service-operation execution context and the service operation code can retrieve the identity information within the operation context.
This recipe will show you how to programmatically retrieve the client authenticated identity information in service operation code.
How to do it...
WCF runtime provides an OperationContext
object associated with each request processing so that the developers can access some operation/request context-specific data...