Features of Windows Communication Foundation v4.5 part 1:
ñ
Multiple
Authentication Support
ñ
Contract
First Development
ñ
Simplified
Generated Configuration
ñ
Validating
WCF Configuration
ñ
Single
WSDL file
ñ
Tooltip
and Intellisense Support
ñ
ASP.NET
Compatibility Mode default change
ñ
BasicHttpsBinding
ñ
Task-based
Programming Model
ñ ChannelFactory Caching
Multiple
Authentication Support:
WCF 4.0 allows to multiple
authentication on a single endpoint and we can sustain further inherited their
authentication directly from IIS or self-hosting.
1)
IIS Hosting :
|
For IIS host services set the property
of authentication schemas as per the requirements. Then in your service’s in web.config file set the ‘clientCredentialType’ as “InheritedFromHost”.
In Web.Config:
<bindings>
|
<basicHttpBinding>
|
<binding name="secureBinding">
|
<security mode="Transport">
|
<transport clientCredentialType="InheritedFromHost" />
|
</security>
|
</binding>
|
</basicHttpBinding>
|
</bindings>
|
You can specify that only subset
of authentication schemas to be used with your service using
ServiceAuthenticationBehaviour or the <serviceAuthenticationManager>
element.
Code Snippet:
ServiceAuthenticationBehavior sab = null; |
sab = serviceHost.Description.Behaviors.Find<ServiceAuthenticationBehavior>();
|
if (sab == null) |
{
|
sab = new ServiceAuthenticationBehavior(); |
sab.AuthenticationSchemes = AuthenticationSchemes.Basic | AuthenticationSchemes.Negotiate | AuthenticationSchemes.Digest;
|
serviceHost.Description.Behaviors.Add(sab);
|
}
|
else |
{
|
sab.AuthenticationSchemes = AuthenticationSchemes.Basic | AuthenticationSchemes.Negotiate | AuthenticationSchemes.Digest;
|
}
|
When configuration this in a
config file , use the <serviceAurhtenticationManager>
Shown in the following.
<behaviors> |
<serviceBehaviors> |
<behavior name="limitedAuthBehavior"> |
<serviceAuthenticationManager authenticationSchemes="Negotiate, Digest, Basic"/> |
<!-- ... --> |
</behavior> |
</serviceBehaviors> |
</behaviors>
|
0 comments:
Thanks for commenting..,,