Partager via


JsonWebTokenUtilities.ValidateToken Method

Namespace:  Microsoft.VisualStudio.Services.WebApi.Jwt
Assembly:  Microsoft.VisualStudio.Services.WebApi (in Microsoft.VisualStudio.Services.WebApi.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public Shared Function ValidateToken ( _
    token As JsonWebToken, _
    parameters As JsonWebTokenValidationParameters _
) As ClaimsPrincipal
public static ClaimsPrincipal ValidateToken(
    this JsonWebToken token,
    JsonWebTokenValidationParameters parameters
)
[ExtensionAttribute]
public:
static ClaimsPrincipal^ ValidateToken(
    JsonWebToken^ token, 
    JsonWebTokenValidationParameters^ parameters
)
static member ValidateToken : 
        token:JsonWebToken * 
        parameters:JsonWebTokenValidationParameters -> ClaimsPrincipal
public static function ValidateToken(
    token : JsonWebToken, 
    parameters : JsonWebTokenValidationParameters
) : ClaimsPrincipal

Parameters

Return Value

Type: System.Security.Claims.ClaimsPrincipal

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type JsonWebToken. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

.NET Framework Security

See Also

Reference

JsonWebTokenUtilities Class

Microsoft.VisualStudio.Services.WebApi.Jwt Namespace