本文整理汇总了VB.NET中System.IdentityModel.Selectors.UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore方法的典型用法代码示例。如果您正苦于以下问题:VB.NET UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore方法的具体用法?VB.NET UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore怎么用?VB.NET UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.IdentityModel.Selectors.UserNameSecurityTokenAuthenticator
的用法示例。
在下文中一共展示了UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: ValidateUserNamePasswordCore
Protected Overrides Function ValidateUserNamePasswordCore(ByVal userName As String, ByVal password As String) As ReadOnlyCollection(Of IAuthorizationPolicy)
If Not ValidateUserNameFormat(userName) Then
Throw New SecurityTokenValidationException("Incorrect UserName format")
End If
Dim setOfClaims As New DefaultClaimSet(ClaimSet.System, New Claim(ClaimTypes.Name, userName, Rights.PossessProperty))
Dim identities As New List(Of IIdentity)(1)
identities.Add(New GenericIdentity(userName))
Dim policies As New List(Of IAuthorizationPolicy)(1)
policies.Add(New UnconditionalPolicy(ClaimSet.System, setOfClaims, DateTime.MaxValue.ToUniversalTime(), identities))
Return policies.AsReadOnly()
End Function 'New
End Class
开发者ID:VB.NET开发者,项目名称:System.IdentityModel.Selectors,代码行数:15,代码来源:UserNameSecurityTokenAuthenticator.ValidateUserNamePasswordCore