How to check authentication in the web-service WCF, if a new session is created when accessing the method? Or authorization information needs to be stored in a web-service session?
1 answer
If the SecurityMode configuration is not set to None, then the user account is accessed via System.ServiceModel.OperationContext.Current.ServiceSecurityContext.PrimaryIdentity .
The issue of WCF authentication is resolved automatically. The default is Cerberos, if there is a domain, and NTLM, if not. But you can configure it so that it is through X509 certificates. With ChannelFactory.Credentials you can replace the user's account on the client.
|