Class ResponsePathTransportCertValidationFilter
- All Implemented Interfaces:
Filter
Filter responsible for validating the inbound request's TLS transport certificate,
when making a request to an Authorisation Server endpoint.
Note that this is a specialised alternative to the TransportCertValidationFilter, which does the same
validation, but does so on the response path. By deferring the validation to the response path we can be sure
that we have an authenticated client, and been provisioned with the client's ApiClient (via the authorization
response).
This filter should be used in flows where, the JWKs to verify the certificate against are obtained from
the ApiClient associated with the authenticated registration request, which is present on the
RegistrationRequestFapiContext following authorization, through inclusion of a
ResponsePathFetchApiClientFilter later in the chain.
certificateIsMandatory controls whether the mTLS certificate is required for all requests processed by
this filter. If it is not required, then validation is skipped if it is not present.
This filter is not expected to be instantiated directly as it is managed as part of the core FAPI Filter
chains e.g. FapiParFilterChainHeaplet.
-
Method Summary
Modifier and TypeMethodDescriptionFilters the request and/or response of an exchange.static FilterCreate an instance of aResponsePathTransportCertValidationFilterwhere the transport cert must always be passed to the token endpoint as it is mandatory for sender constrained access tokens.static FilterCreate an instance of aResponsePathTransportCertValidationFilterwhere the transport cert is optional, only required when doingtls_client_auth.
-
Method Details
-
filter
public Promise<Response,NeverThrowsException> filter(Context context, Request request, Handler next) Description copied from interface:FilterFilters the request and/or response of an exchange. To pass the request to the next filter or handler in the chain, the filter callsnext.handle(context, request).This method may elect not to pass the request to the next filter or handler, and instead handle the request itself. It can achieve this by merely avoiding a call to
next.handle(context, request)and creating its own response object. The filter is also at liberty to replace a response with another of its own by intercepting the response returned by the next handler. -
mandatoryTransportCertValidationFilter
Create an instance of aResponsePathTransportCertValidationFilterwhere the transport cert must always be passed to the token endpoint as it is mandatory for sender constrained access tokens.- Returns:
ResponsePathTransportCertValidationFilterconfigured for validation of a mandatory cert
-
optionalTransportCertValidationFilter
Create an instance of aResponsePathTransportCertValidationFilterwhere the transport cert is optional, only required when doingtls_client_auth.- Returns:
ResponsePathTransportCertValidationFilterconfigured validation of a cert that may not be present
-