Class ManageApiClientFilter

java.lang.Object
org.forgerock.openig.fapi.dcr.apiclient.ManageApiClientFilter
All Implemented Interfaces:
Filter

public class ManageApiClientFilter extends Object implements Filter
Filter to manage 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 ApiClient and ApiClientOrganisation (if the organisation does not already exist) in the data store.
  • GET requests fetch the ApiClient from the data store.
  • PUT requests update the ApiClient in the data store.
  • DELETE requests delete the ApiClient from the data store.
All operations add the ApiClient object to the 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 Details

  • Method Details

    • filter

      public Promise<Response,NeverThrowsException> filter(Context context, Request request, Handler next)
      Description copied from interface: Filter
      Filters the request and/or response of an exchange. To pass the request to the next filter or handler in the chain, the filter calls next.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.

      Specified by:
      filter in interface Filter
      Parameters:
      context - The request context.
      request - The request.
      next - The next filter or handler in the chain to handle the request.
      Returns:
      A Promise representing the response to be returned to the client.