Class McpClientRegistrationManager.Builder
java.lang.Object
org.apache.juneau.rest.client.mcp.auth.McpClientRegistrationManager.Builder
- Enclosing class:
- McpClientRegistrationManager
Builder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets theapplication_typedeclared when the manager performs DCR.build()Builds the manager.clientName(String value) Sets the human-readable client name declared during DCR.confidential(boolean value) Registers a confidential client during DCR (default public/native).httpRequestConfigurator(Consumer<com.nimbusds.oauth2.sdk.http.HTTPRequest> value) Sets a callback that customizes the NimbusHTTPRequestfor each DCR request.httpTimeout(Duration value) Sets the connect/read timeout applied to DCR requests.initialAccessToken(String value) Sets the RFC 7591 §3 initial access token for a protected registration endpoint.Sets pre-registered (manually provisioned) credentials bound to a specific ASissuer.redirectUris(List<URI> values) Sets the redirect URIs to register when the manager performs DCR.redirectUrisSupplier(Supplier<List<URI>> value) Sets a supplier of redirect URIs to register when the manager performs DCR (for the bind-first strategy where the loopback port is learned per-connection).Overrides the registration function the manager invokes to perform DCR (advanced / test seam).Adds scopes requested during DCR.store(McpClientRegistrationStore value) Sets the optional issuer-keyed credential store.
-
Constructor Details
-
Builder
protected Builder()Constructor.
-
-
Method Details
-
store
Sets the optional issuer-keyed credential store. When omitted, the manager runs in on-demand mode and performs a fresh DCR on everyresolve(...)call (compliant).- Parameters:
value- The store. Must not benull .- Returns:
- This object.
-
preRegistered
Sets pre-registered (manually provisioned) credentials bound to a specific ASissuer.- Parameters:
value- The pre-registered credentials. Must not benull .- Returns:
- This object.
-
applicationType
Sets theapplication_typedeclared when the manager performs DCR. DefaultMcpApplicationType.NATIVE.- Parameters:
value- The application type. Must not benull .- Returns:
- This object.
-
redirectUris
Sets the redirect URIs to register when the manager performs DCR.- Parameters:
values- The redirect URIs (e.g.LoopbackRedirectUris.portAgnostic(String)). Must not benull or empty.- Returns:
- This object.
-
redirectUrisSupplier
Sets a supplier of redirect URIs to register when the manager performs DCR (for the bind-first strategy where the loopback port is learned per-connection).- Parameters:
value- The supplier. Must not benull .- Returns:
- This object.
-
scope
Adds scopes requested during DCR.- Parameters:
values- The scopes.- Returns:
- This object.
-
confidential
Registers a confidential client during DCR (default public/native).- Parameters:
value-true to register a confidential client.- Returns:
- This object.
-
clientName
Sets the human-readable client name declared during DCR.- Parameters:
value- The client name.- Returns:
- This object.
-
initialAccessToken
Sets the RFC 7591 §3 initial access token for a protected registration endpoint.- Parameters:
value- The initial access token. Must not benull or blank.- Returns:
- This object.
-
httpTimeout
Sets the connect/read timeout applied to DCR requests. Default 10 seconds.- Parameters:
value- The timeout. Must not benull and must be positive.- Returns:
- This object.
-
httpRequestConfigurator
public McpClientRegistrationManager.Builder httpRequestConfigurator(Consumer<com.nimbusds.oauth2.sdk.http.HTTPRequest> value) Sets a callback that customizes the NimbusHTTPRequestfor each DCR request.- Parameters:
value- The callback. Must not benull .- Returns:
- This object.
-
registrarFunction
public McpClientRegistrationManager.Builder registrarFunction(Function<OidcMetadata, McpClientRegistration> value) Overrides the registration function the manager invokes to perform DCR (advanced / test seam).The default builds an
McpDynamicClientRegistrarfrom the discoveredOidcMetadataand performs a live RFC 7591 round-trip; supply this to inject an alternate registration strategy or a stub.- Parameters:
value- The registration function mapping a discovered AS to an issuedMcpClientRegistration. Must not benull .- Returns:
- This object.
-
build
Builds the manager.- Returns:
- A new
McpClientRegistrationManager.
-