Show / Hide Table of Contents

Class JwtValidationResult

The resulting object from a JWT-validation induced via ValidateToken(String, TokenValidationParameters).

Inheritance
System.Object
JwtValidationResult
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: GlitchedPolygons.Services.JwtService
Assembly: GlitchedPolygons.Services.JwtService.dll
Syntax
public class JwtValidationResult

Constructors

| Improve this Doc View Source

JwtValidationResult(Tuple<JwtSecurityToken, IPrincipal>, Exception, String)

Creates a JwtValidationResult instance.

Declaration
public JwtValidationResult(Tuple<JwtSecurityToken, IPrincipal> validatedToken, Exception exception, string errorMessage)
Parameters
Type Name Description
System.Tuple<System.IdentityModel.Tokens.Jwt.JwtSecurityToken, System.Security.Principal.IPrincipal> validatedToken

The validated token's System.Tuple containing both the decoded System.IdentityModel.Tokens.Jwt.JwtSecurityToken and the System.Security.Principal.IPrincipal instance with all of its mapped System.Security.Claims.Claims.

System.Exception exception

The thrown Exception in case of a failure.

System.String errorMessage

The error message string in case of a failure.

Properties

| Improve this Doc View Source

Claims

Gets the associated token's claims (from the JWT payload).

Declaration
public IEnumerable<Claim> Claims { get; }
Property Value
Type Description
System.Collections.Generic.IEnumerable<System.Security.Claims.Claim>
| Improve this Doc View Source

ErrorMessage

The error message string in case of a failure.

Declaration
public string ErrorMessage { get; }
Property Value
Type Description
System.String
| Improve this Doc View Source

Exception

The thrown Exception in case of a failure.

Declaration
public Exception Exception { get; }
Property Value
Type Description
System.Exception
| Improve this Doc View Source

Item[String]

Get the token's claim by type name (claims are key-value strings inside the JWT's payload json).

Declaration
public Claim this[string claimKey] { get; }
Parameters
Type Name Description
System.String claimKey

The claim key (System.Security.Claims.Claim.Type).

Property Value
Type Description
System.Security.Claims.Claim

The System.Security.Claims.Claim value if it was found inside the JWT claims payload; null otherwise.

| Improve this Doc View Source

Successful

Was the validation successful?

Declaration
public bool Successful { get; }
Property Value
Type Description
System.Boolean
| Improve this Doc View Source

ValidatedToken

The validated token containing all of its linked System.Security.Claims.Claims and other payload elements.

It's a System.Tuple<T1, T2> containing both the raw, validated System.IdentityModel.Tokens.Jwt.JwtSecurityToken and the deserialized System.Security.Principal.IPrincipal instance.

Declaration
public Tuple<JwtSecurityToken, IPrincipal> ValidatedToken { get; }
Property Value
Type Description
System.Tuple<System.IdentityModel.Tokens.Jwt.JwtSecurityToken, System.Security.Principal.IPrincipal>
  • Improve this Doc
  • View Source
Back to top Generated by DocFX