Skip to main content

ErrorFactory Class

Abblix.Oidc.Server

Abblix.Oidc.Server.Endpoints.Authorization.Validation

ErrorFactory Class

Provides a factory for creating standardized authorization request error responses. This factory simplifies the creation of error responses for various types of validation failures during authorization request processing.

public static class ErrorFactory

Inheritance System.Object → ErrorFactory

Methods

ErrorFactory.Error(this AuthorizationValidationContext, string, string) Method

Creates an AuthorizationRequestValidationError with a specified error code and description, using the context from an AuthorizationValidationContext.

public static Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationRequestValidationError Error(this Abblix.Oidc.Server.Endpoints.Authorization.Validation.AuthorizationValidationContext context, string error, string description);

Parameters

context AuthorizationValidationContext

The validation context associated with the authorization request.

error System.String

The error code as defined by the OpenID Connect and OAuth 2.0 specifications.

description System.String

A human-readable description of the error.

Returns

AuthorizationRequestValidationError
An AuthorizationRequestValidationError instance encapsulating the error details.

ErrorFactory.InvalidAuthorizationDetails(this AuthorizationValidationContext, string) Method

Creates an AuthorizationRequestValidationError indicating an invalid authorization_details array per RFC 9396 §4 / §5. Used when an entry references an unknown type, fails per-type schema validation, or is not in the per-client allowlist.

public static Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationRequestValidationError InvalidAuthorizationDetails(this Abblix.Oidc.Server.Endpoints.Authorization.Validation.AuthorizationValidationContext context, string description);

Parameters

context AuthorizationValidationContext

The validation context associated with the request.

description System.String

A human-readable description of the rejection cause.

Returns

AuthorizationRequestValidationError
An AuthorizationRequestValidationError with the RAR-specific error code.

ErrorFactory.InvalidClient(string) Method

Creates an AuthorizationRequestValidationError indicating an invalid client error. This error type is used when the client authentication fails or when the client is not authorized to perform the requested operation. It may occur due to issues like incorrect client credentials, unauthorized grant types for the client, or the client being unknown to the authorization server.

public static Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationRequestValidationError InvalidClient(string description);

Parameters

description System.String

A human-readable description specifying why the client is considered invalid.

Returns

AuthorizationRequestValidationError
An AuthorizationRequestValidationError with the specified error details, indicating that the error relates to an invalid client.

ErrorFactory.InvalidRequest(string) Method

Creates an AuthorizationRequestValidationError for a general invalid request error, without an associated validation context.

public static Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationRequestValidationError InvalidRequest(string description);

Parameters

description System.String

A description of what was invalid about the request.

Returns

AuthorizationRequestValidationError
An AuthorizationRequestValidationError with the specified error details.

ErrorFactory.InvalidRequest(this AuthorizationValidationContext, string) Method

Creates an AuthorizationRequestValidationError indicating an invalid request. This error type is commonly used when an authorization request fails due to missing or invalid parameters.

public static Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationRequestValidationError InvalidRequest(this Abblix.Oidc.Server.Endpoints.Authorization.Validation.AuthorizationValidationContext context, string description);

Parameters

context AuthorizationValidationContext

The validation context associated with the request, providing additional context for the error response.

description System.String

A human-readable explanation detailing what was invalid about the request.

Returns

AuthorizationRequestValidationError
An AuthorizationRequestValidationError instance encapsulating the error details.

ErrorFactory.InvalidRequestObject(string) Method

Creates an AuthorizationRequestValidationError indicating an invalid request object. This error is used when the request object (JWT) in an authorization request is invalid, such as when signature validation fails or required claims are missing.

public static Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationRequestValidationError InvalidRequestObject(string description);

Parameters

description System.String

A description of the issue with the request object.

Returns

AuthorizationRequestValidationError
An AuthorizationRequestValidationError for the invalid request object.

ErrorFactory.InvalidRequestUri(string) Method

Creates an AuthorizationRequestValidationError indicating an invalid request URI. This error is used when the request_uri parameter of an authorization request is invalid or malformed.

public static Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationRequestValidationError InvalidRequestUri(string description);

Parameters

description System.String

A description of the issue with the request URI.

Returns

AuthorizationRequestValidationError
An AuthorizationRequestValidationError for the invalid request URI.

ErrorFactory.InvalidScope(this AuthorizationValidationContext, string) Method

Creates an AuthorizationRequestValidationError indicating an invalid scope error. This error type is used when the scopes requested by the client are not supported or are inappropriate for the requested operation.

public static Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationRequestValidationError InvalidScope(this Abblix.Oidc.Server.Endpoints.Authorization.Validation.AuthorizationValidationContext context, string description);

Parameters

context AuthorizationValidationContext

The validation context associated with the request, providing additional context for the error response.

description System.String

A human-readable description of why the requested scopes are invalid.

Returns

AuthorizationRequestValidationError
An AuthorizationRequestValidationError with details about the scope-related issue.

ErrorFactory.ValidationError(string, string) Method

A private helper method to create an AuthorizationRequestValidationError with a specified error code and description.

public static Abblix.Oidc.Server.Endpoints.Authorization.Interfaces.AuthorizationRequestValidationError ValidationError(string error, string description);

Parameters

error System.String

The error code as defined by the OpenID Connect and OAuth 2.0 specifications.

description System.String

A human-readable description of the error.

Returns

AuthorizationRequestValidationError
An AuthorizationRequestValidationError instance with the specified error details.