#### [Abblix\.Oidc\.Server](https://www.abblix.com/en/docs/api/abblix-oidc-server 'index')
### [Abblix\.Oidc\.Server\.Endpoints\.Token\.Grants](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Endpoints.Token.Grants 'Abblix\.Oidc\.Server\.Endpoints\.Token\.Grants')

## ErrorFactory Class

Builds [OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError') instances using the error codes RFC 6749 §5\.2 defines for
the token endpoint\. Mirrors the sibling per\-area factories \(authorization validation,
dynamic client registration, secure HTTP fetch\): each area exposes only the error codes
its specification legitimately uses, so codes from one protocol surface do not leak into
another\.

```csharp
public static class ErrorFactory
```

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

## ErrorFactory\.InvalidRequest\(string\) Method {#Abblix.Oidc.Server.Endpoints.Token.Grants.ErrorFactory.InvalidRequest(string)}

Creates an error for a malformed token request — a missing, repeated, or otherwise
invalid parameter \(RFC 6749 §5\.2, `invalid_request`\)\.

```csharp
public static Abblix.Oidc.Server.Common.OidcError InvalidRequest(string description);
```
#### Parameters

###### `description` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Endpoints.Token.Grants.ErrorFactory.InvalidRequest(string).description}

The description of the error\.

#### Returns
[OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError')  
An error instance with the error code and description\.

## ErrorFactory\.MissingParameter\(string\) Method {#Abblix.Oidc.Server.Endpoints.Token.Grants.ErrorFactory.MissingParameter(string)}

Creates an error for a token request whose required parameter is absent
\(RFC 6749 §5\.2, `invalid_request`\)\.

```csharp
public static Abblix.Oidc.Server.Common.OidcError MissingParameter(string parameterName);
```
#### Parameters

###### `parameterName` [System\.String](https://learn.microsoft.com/en-us/dotnet/api/system.string 'System\.String') {#Abblix.Oidc.Server.Endpoints.Token.Grants.ErrorFactory.MissingParameter(string).parameterName}

The wire\-level name of the missing parameter\.

#### Returns
[OidcError](https://www.abblix.com/en/docs/api/abblix-oidc-server/Abblix.Oidc.Server.Common.OidcError 'Abblix\.Oidc\.Server\.Common\.OidcError')  
An error instance with the error code and description\.
