Class ManageApiClientFilter
- All Implemented Interfaces:
Filter
ApiClients in a data store as part of protecting an OAuth2.0 /register (DCR) endpoint. It
requires PrepareApiClientContextFilter previous in the filer chain.
Supports CRUD operations for ApiClients as part of DCR calls, the following operations are supported:
-
POST requests create a new
ApiClientandApiClientOrganisation(if the organisation does not already exist) in the data store. -
GET requests fetch the
ApiClientfrom the data store. -
PUT requests update the
ApiClientin the data store. -
DELETE requests delete the
ApiClientfrom the data store.
ApiClientFapiContext, so that it is available to other
filters.
These operations occur on the response path and only take place if the upstream response is a success, this ensures that the Authorization Server has validated and processed the request first.
Taking the POST flow as an example, in this flow the client is completing a new DCR in order to register themselves as an OAuth2.0 client, an ApiClient is created in the data store if registration is successful.
The ApiClient stores information about the registration that is used when this client makes calls to other endpoints protected by PingGateway in order to enforce security rules e.g. that the ApiClient has the correct roles to perform an operation or to validate the client's mtls certificate.
This filter is not expected to be instantiated directly as it is managed as part of the core FAPI Filter
chains e.g. FapiDcrFilterChainHeaplet.
-
Constructor Summary
ConstructorsConstructorDescriptionManageApiClientFilter(ApiClientService apiClientService, ApiClientOrganisationService apiClientOrganisationService, Expression<String> clientIdExpression) Default constructor. -
Method Summary
-
Constructor Details
-
ManageApiClientFilter
public ManageApiClientFilter(ApiClientService apiClientService, ApiClientOrganisationService apiClientOrganisationService, Expression<String> clientIdExpression) Default constructor.- Parameters:
apiClientService- theApiClientServiceto useapiClientOrganisationService- theApiClientOrganisationServiceto useclientIdExpression- theExpressionto retrieve theclient_id
-
-
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.
-