#### [Abblix\.Jwt](https://www.abblix.com/en/docs/api/abblix-jwt 'index')
### [Abblix\.Jwt](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt 'Abblix\.Jwt')

## JwtValidationError Class

Represents an error encountered during the validation of a JSON Web Token \(JWT\)\.

```csharp
public record JwtValidationError : System.IEquatable<Abblix.Jwt.JwtValidationError>
```

Inheritance [System\.Object](https://learn.microsoft.com/en-us/dotnet/api/system.object 'System\.Object') → JwtValidationError

Implements [System\.IEquatable&lt;](https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1 'System\.IEquatable\`1')[JwtValidationError](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JwtValidationError 'Abblix\.Jwt\.JwtValidationError')[&gt;](https://learn.microsoft.com/en-us/dotnet/api/system.iequatable-1 'System\.IEquatable\`1')
### Constructors

## JwtValidationError\(JwtError, string\) Constructor {#Abblix.Jwt.JwtValidationError.JwtValidationError(Abblix.Jwt.JwtError,string)}

Represents an error encountered during the validation of a JSON Web Token \(JWT\)\.

```csharp
public JwtValidationError(Abblix.Jwt.JwtError Error, string ErrorDescription);
```
#### Parameters

###### `Error` [JwtError](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JwtError 'Abblix\.Jwt\.JwtError') {#Abblix.Jwt.JwtValidationError.JwtValidationError(Abblix.Jwt.JwtError,string).Error}

The specific type of JWT error encountered\.

###### `ErrorDescription` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Jwt.JwtValidationError.JwtValidationError(Abblix.Jwt.JwtError,string).ErrorDescription}

A description of the error providing details about the validation failure\.
### Properties

## JwtValidationError\.Error Property {#Abblix.Jwt.JwtValidationError.Error}

The specific type of JWT error encountered\.

```csharp
public Abblix.Jwt.JwtError Error { get; init; }
```

#### Property Value
[JwtError](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JwtError 'Abblix\.Jwt\.JwtError')

## JwtValidationError\.ErrorDescription Property {#Abblix.Jwt.JwtValidationError.ErrorDescription}

A description of the error providing details about the validation failure\.

```csharp
public string ErrorDescription { get; init; }
```

#### Property Value
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')
### Methods

## JwtValidationError\.ToString\(\) Method {#Abblix.Jwt.JwtValidationError.ToString()}

Returns the error description as the textual representation of this validation error,
preserving the original capitalization of [ErrorDescription](https://www.abblix.com/en/docs/api/abblix-jwt/Abblix.Jwt.JwtValidationError#Abblix.Jwt.JwtValidationError.ErrorDescription 'Abblix\.Jwt\.JwtValidationError\.ErrorDescription')\.

```csharp
public override string ToString();
```

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')

## JwtValidationError\.ToString\(bool\) Method {#Abblix.Jwt.JwtValidationError.ToString(bool)}

Formats a user\-friendly description of the JWT validation error with proper sentence capitalization\.

```csharp
public string ToString(bool forceLowercaseFirst);
```
#### Parameters

###### `forceLowercaseFirst` [System\.Boolean](https://learn.microsoft.com/en-us/dotnet/api/system.boolean 'System\.Boolean') {#Abblix.Jwt.JwtValidationError.ToString(bool).forceLowercaseFirst}

If true, converts the first letter to lowercase for embedding in larger sentences\.
If false, preserves the original capitalization\. Default is true\.

#### Returns
[System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String')  
The error description, optionally with the first letter in lowercase if a description is available,
otherwise returns the error code as a string\.

### Remarks
This method is useful for embedding error descriptions in the middle of sentences,
where starting with a lowercase letter maintains proper grammar\.
Example with forceLowercaseFirst=true: "The id token hint contains invalid token: token has expired"
Example with forceLowercaseFirst=false: "Token has expired"
