本文整理匯總了C#中System.IdentityModel.Selectors.UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore方法的典型用法代碼示例。如果您正苦於以下問題:C# UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore方法的具體用法?C# UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore怎麽用?C# UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類System.IdentityModel.Selectors.UserNameSecurityTokenAuthenticator
的用法示例。
在下文中一共展示了UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ValidateUserNamePasswordCore
protected override ReadOnlyCollection<IAuthorizationPolicy> ValidateUserNamePasswordCore(string userName, string password)
{
if (!ValidateUserNameFormat(userName))
throw new SecurityTokenValidationException("Incorrect UserName format");
ClaimSet claimSet = new DefaultClaimSet(ClaimSet.System, new Claim(ClaimTypes.Name, userName, Rights.PossessProperty));
List<IIdentity> identities = new List<IIdentity>(1);
identities.Add(new GenericIdentity(userName));
List<IAuthorizationPolicy> policies = new List<IAuthorizationPolicy>(1);
policies.Add(new UnconditionalPolicy(ClaimSet.System, claimSet, DateTime.MaxValue.ToUniversalTime(), identities));
return policies.AsReadOnly();
}
開發者ID:.NET開發者,項目名稱:System.IdentityModel.Selectors,代碼行數:12,代碼來源:UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore