Wcf and windows authentication




















It can looks like nice because inside of database one sees from which user the request come. But in a lot of real situation the usage of impersonation not really solve a problem, but only forward it.

Who should administrate permission inside of the database? With respect of which tool one should grant permission to users. Who makes user administration in your corporation? So because of existing processes in your corporation the user impersonation could be not the best choice. For example in the last project which I implemented I wrote a WCF service which has a lot of methods.

Inside of every method direct at the beginning of the method I used Microsoft Authorization Manager API to verify whether the user has permission for the corresponding operation or not. One used Authorization Manager Snap-In to grant permission to user through assigning it to some application role. Nevertheless the solution was secure and one had a tool for the user administration which corresponds to business requirements. I have too less information about you environment and business requirements to give you one recommendation.

I want only explain that you probably need to make a security concept of your solution based on different possibilities which you have. How are we doing? Please help us improve Stack Overflow. Take our short survey. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Collectives on Stack Overflow. Learn more. Asked 11 years, 6 months ago. Active 10 years, 1 month ago.

Viewed 2k times. Here is my config file for the WCF service. Improve this question. John Saunders k 25 25 gold badges silver badges bronze badges.

For more information about how to override or specify service identity, see Overriding the Identity of a Service for Authentication. If you change the client credential type in the binding previously shown to Certificate, then the generated WSDL contains a Base64 serialized X.

This is the default for all client credential types other than Windows. The following configuration code sets a domain name system DNS identity with the value contoso. Your service does not have to explicitly specify an identity, because WCF automatically determines it. However, WCF allows you to specify an identity on an endpoint, if required. The following code adds a new service endpoint with a specific DNS identity. The generated configuration file intended for use by the client contains the server's identity.

For example, the following code is generated from a service that specifies a DNS identity, as shown in the preceding example. Note that the client's endpoint identity value matches that of the service. In this case, when the client receives the Windows Kerberos credentials for the service, it expects the value to be contoso. If, instead of Windows, the service specifies a certificate as the client credential type, then the certificate's DNS property is expected to be the value contoso.

Or if the DNS property is null , the certificate's subject name must be contoso. The following client configuration file shows how the service's identity is expected to be a specific value. In the following example, the client can communicate with two endpoints.

The first is identified with a certificate thumbprint and the second with a certificate RSA key. At design time, a client developer determines the server's identity through its metadata. At run time, the identity check is performed before calling any endpoints on the service.

The identity value is tied to the type of authentication specified by metadata; in other words, the type of credentials used for the service. Note that these checks are done in addition to determining the validity of the server certificate. By default, WCF validates that the server certificate is issued by a trusted root authority. During the SSL handshake, WCF ensures that the remote endpoint provides the exact certificate value specified in the identity. If the service authenticates using message- or transport-level SSL with a Windows credential for authentication, and negotiates the credential, the following identity values are valid:.

The UPN of the service account. The UPN is in the form username domain. For example, when the service is running in a user account, it may be username contoso. Specifying the identity programmatically using the Identity property is optional. If no identity is specified, and the client credential type is a certificate, the default is Certificate. This applies to both message- and transport-level security. Because the identity of a service depends on the binding type used, ensure that an appropriate identity is exposed when creating a custom binding.

For example, in the following code example, the identity exposed is not compatible with the security type, because the identity for the secure conversation bootstrap binding does not match the identity for the binding on the endpoint. When selecting the potential authentication schemes for an HTTP server, a few items to consider include the following:. Consider whether the resource needs to be protected.

Using HTTP authentication requires transmitting more data and can limit interoperability with clients. Allow anonymous access to resources that do not need to be protected. If the resource needs to be protected, consider which authentication schemes provide the required level of security.

The weakest standard authentication scheme discussed here is Basic authentication. Basic authentication does not protect the user's credentials. The strongest standard authentication scheme is Negotiate authentication, resulting in the Kerberos protocol. A server should not present in the WWW-Authentication headers any scheme that it is not prepared to accept or that does not adequately secure the protected resource.

Clients are free to choose between any of the authentication schemes the server presents. Some clients default to a weak authentication scheme or the first authentication scheme in the server's list.

Skip to main content. This browser is no longer supported. Download Microsoft Edge More info. Contents Exit focus mode. Is this page helpful?



0コメント

  • 1000 / 1000