本文整理匯總了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