What should you do?

You are creating an application by using Microsoft .NET Framework 3.5. You use Windows Communication Foundation (WCF) to create the application. The YourUserNamePasswordValidator class is implemented in the host application of the WCF service. The host application is named YourServiceHost.exe. You write the following code segment.

namespace YourSecureService
{
class YourUserNamePasswordValidator : UserNamePasswordValidator {
public override void Validate(string userName, string password)
{

}}
}

You need to perform custom validation of the user name and password by using the YourUserNamePasswordValidator class. What should you do?

You are creating an application by using Microsoft .NET Framework 3.5. You use Windows Communication Foundation (WCF) to create the application. The YourUserNamePasswordValidator class is implemented in the host application of the WCF service. The host application is named YourServiceHost.exe. You write the following code segment.

namespace YourSecureService
{
class YourUserNamePasswordValidator : UserNamePasswordValidator {
public override void Validate(string userName, string password)
{

}}
}

You need to perform custom validation of the user name and password by using the YourUserNamePasswordValidator class. What should you do?

A.
Set the wsHttpBinding binding in the following manner.
<security mode=”Message”>
<message clientCredentialType=”UserName” />
</security>
Set the service behavior by using thefollowing credentials.
<userNameAuthentication customUserNamePasswordValidatorType=”YourSecureService.YourUserNamePasswordValidator” userNamePasswordValidationMode=”Custom”/>

B.
Set the wsHttpBinding binding in the following manner.
<security mode=”Message”>
<message clientCredentialType=”UserName” />
</security>
Set the service behavior by using the following credentials.
<userNameAuthentication customUserNamePasswordValidatorType=”YourSecureService.YourUserNamePasswordValidator,YourServiceHost” userNamePasswordValidationMode=”Custom”/>

C.
Set the wsHttpBinding binding in the following manner.
<security mode=”Message”>
<transport clientCredentialType=”UserName” />
</security>
Set the service behavior by using the following credentials.
<userNameAuthentication customUserNamePasswordValidatorType=”YourUserNamePasswordValidator,YourServiceHost” userNamePasswordValidationMode=”Custom”/>

D.
Set the netTcpBinding binding in the following manner.
<security mode=”Transport”>
<transport clientCredentialType=”UserName” />
</security>
Set the service behavior by using the following credentials.
<userNameAuthentication customUserNamePasswordValidatorType=”YourSecureService.YourUserNamePasswordValidator ” userNamePasswordValidationMode=”Custom”/>

Explanation:
<serviceCredentials>
<userNameAuthentication userNamePasswordValidationMode=”Custom” customUserNamePasswordValidatorType=”Microsoft.ServiceModel.Samples.CalculatorService.CustomUserNameValidator, service” />
</serviceCredentials>

http://msdn.microsoft.com/en-us/library/aa702565.aspx



Leave a Reply 0

Your email address will not be published. Required fields are marked *