Class McpDynamicClientRegistrar.Builder
java.lang.Object
org.apache.juneau.rest.client.mcp.auth.McpDynamicClientRegistrar.Builder
- Enclosing class:
- McpDynamicClientRegistrar
Builder.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddGrantType(String... values) Adds requestedgrant_types(accumulates across calls).addRedirectUri(URI... values) Adds one or more redirect URIs to register (accumulates across calls).addRedirectUris(List<URI> values) Adds a list of redirect URIs to register (accumulates across calls).addResponseType(String... values) Adds requestedresponse_types(accumulates across calls).Sets theapplication_type(SEP-837 MUST).build()Builds the registrar.clientName(String value) Sets the human-readableclient_name.confidential(boolean value) Registers a confidential client (token_endpoint_auth_method=client_secret_basic) instead of the default public/native client (token_endpoint_auth_method=none).httpRequestConfigurator(Consumer<com.nimbusds.oauth2.sdk.http.HTTPRequest> value) Sets a callback that customizes the NimbusHTTPRequestfor the registration call.httpTimeout(Duration value) Sets the connect/read timeout applied to the registration request.initialAccessToken(String value) Sets the RFC 7591 §3 initial access token used to authorize the call to a protected registration endpoint.Sets the ASissuerthese credentials are being registered with.registrationEndpoint(URI value) Sets the ASregistration_endpointURL.Adds requested scopes.
-
Constructor Details
-
Builder
protected Builder()Constructor.
-
-
Method Details
-
registrationEndpoint
Sets the ASregistration_endpointURL. Required.- Parameters:
value- The registration endpoint (typically from validated AS metadata'sregistration_endpoint).- Returns:
- This object.
-
issuer
Sets the ASissuerthese credentials are being registered with. Required.Stamped onto the resulting
McpClientRegistrationas the SEP-2352 credential-binding key.- Parameters:
value- The issuer URI.- Returns:
- This object.
-
applicationType
Sets theapplication_type(SEP-837 MUST). Required.- Parameters:
value- The application type.- Returns:
- This object.
-
addRedirectUri
Adds one or more redirect URIs to register (accumulates across calls). At least one is required.- Parameters:
values- The redirect URIs (e.g. fromLoopbackRedirectUris.forPort(int, String)).- Returns:
- This object.
-
addRedirectUris
Adds a list of redirect URIs to register (accumulates across calls). At least one is required.- Parameters:
values- The redirect URIs (e.g. fromLoopbackRedirectUris.forPort(int, String)).- Returns:
- This object.
-
scope
Adds requested scopes.- Parameters:
values- The scopes.- Returns:
- This object.
-
addGrantType
Adds requestedgrant_types(accumulates across calls). When none are added, defaults toauthorization_code+refresh_token.- Parameters:
values- The grant type identifiers.- Returns:
- This object.
-
addResponseType
Adds requestedresponse_types(accumulates across calls). When none are added, defaults tocode.- Parameters:
values- The response type identifiers.- Returns:
- This object.
-
confidential
Registers a confidential client (token_endpoint_auth_method=client_secret_basic) instead of the default public/native client (token_endpoint_auth_method=none).- Parameters:
value-true to register a confidential client.- Returns:
- This object.
-
clientName
Sets the human-readableclient_name.- Parameters:
value- The client name.- Returns:
- This object.
-
initialAccessToken
Sets the RFC 7591 §3 initial access token used to authorize the call to 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 the registration request. Default 10 seconds.- Parameters:
value- The timeout. Must not benull and must be positive.- Returns:
- This object.
-
httpRequestConfigurator
public McpDynamicClientRegistrar.Builder httpRequestConfigurator(Consumer<com.nimbusds.oauth2.sdk.http.HTTPRequest> value) Sets a callback that customizes the NimbusHTTPRequestfor the registration call.- Parameters:
value- The callback. Must not benull .- Returns:
- This object.
-
build
Builds the registrar.- Returns:
- A new
McpDynamicClientRegistrar.
-