[英]WCF Custom Validator
While setting up a CustomValidator I'm getting the following error: 设置CustomValidator时,出现以下错误:
Could not load file or assembly 'Ringo.Authentication' or one of its dependencies. 无法加载文件或程序集“ Ringo.Authentication”或其依赖项之一。 The system cannot find the file specified.
该系统找不到指定的文件。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.IdentityModel.Selectors;
using System.IdentityModel.Tokens;
using Ringo.Utilities;
namespace Ringo.Authentication
{
public class CustomUserNameValidator : UserNamePasswordValidator
{
public override void Validate(string Username, string Password)
{
Accounts account = new Accounts();
if (account.CheckUserAccount(Username, Password))
{
return;
}
throw new SecurityTokenException("Accout is Invalid");
}
}
}
<serviceCredentials >
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Ringo.Authentication.CustomUserNameValidator, Ringo.Authentication"/>
</serviceCredentials>
Any help would be great thanks! 任何帮助将非常感谢!
The Following: 下列:
<serviceCredentials >
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Ringo.Authentication.CustomUserNameValidator, **Ringo.Authentication**"/>
</serviceCredentials>
Should Be: 应该:
<serviceCredentials >
<userNameAuthentication userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Ringo.Authentication.CustomUserNameValidator, **Ringo**"/>
</serviceCredentials>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.