Package org.forgerock.openig.mcp
Class McpProtectionFilterHeaplet
java.lang.Object
org.forgerock.openig.heap.GenericHeaplet
org.forgerock.openig.mcp.McpProtectionFilterHeaplet
- All Implemented Interfaces:
Heaplet
Heaplet protecting an MCP server as an OAuth 2.0 Protected Resource, according to the MCP specification.
This filter wraps an OAuth2ResourceServerFilter and adds the following features:
- The registration of a static MCP OAuth 2.0 Protected Resource Metadata at the /.well-known/oauth-protected-resource URL
- The adaptation of the potential WWW-Authenticate response header to include a resource_metadata directive
- The validation of the resource claim in the OAuth2 Access Token
{
"type": "McpProtectionFilter",
"config": {
"resourceId": String [REQUIRED - the resource ID to return.]
"authorizationServerUri": URI [REQUIRED - the Authorization Server URL to contact for access tokens.]
"resourceServerFilter": Filter [REQUIRED - the OAuth2ResourceServerFilter instance to validate access
tokens.]
"supportedScopes": String[][OPTIONAL - The list of supported scopes to return in the resource metadata.
Defaults to none.]
"realm": String [OPTIONAL - specifies the name of the realm used in the authentication
challenges returned back to the client in case of errors.
Defaults to no realm.]
"resourceIdPointer": String [OPTIONAL - the JSON Pointer path to the resource ID claim in the access token.
Defaults to "/aud".]
"wellKnownFilter": Filter [OPTIONAL - Filter to apply to requests targeting the well-known endpoint
(e.g. a CorsFilter to allow browser preflight requests).
Defaults to none. A warning is logged at startup when absent.]
}
}
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.forgerock.openig.heap.GenericHeaplet
create, endpointRegistry, evaluatedWithHeapProperties, expression, getConfig, getHeap, getType, initialBindings, meterRegistryHolder, start
-
Constructor Details
-
McpProtectionFilterHeaplet
public McpProtectionFilterHeaplet()
-
-
Method Details
-
create
Description copied from class:GenericHeapletCalled to request the heaplet create an object. Called byHeaplet.create(Name, JsonValue, Heap)after initializing the protected field members. Implementations should parse configuration but not acquire resources, start threads, or log any initialization messages. These tasks should be performed by theGenericHeaplet.start()method.- Specified by:
createin classGenericHeaplet- Returns:
- The created object.
- Throws:
HeapException- if an exception occurred during creation of the heap object or any of its dependencies.
-
destroy
public void destroy()Description copied from interface:HeapletCalled to indicate that the object created by the heaplet is going to be dereferenced. This gives the heaplet an opportunity to free any resources that are being held prior to its dereference.- Specified by:
destroyin interfaceHeaplet- Overrides:
destroyin classGenericHeaplet
-