parameters, String authorization,
+ String[] clientCertificatePath)
+ {
+ return handle(api, spi, parameters, authorization, clientCertificatePath, null, null, null);
+ }
+
+
/**
* Handle a backchannel authentication request in CIBA (Client Initiated
* Backchannel Authentication) flow.
@@ -47,8 +83,8 @@ public class BaseBackchannelAuthenticationEndpoint extends BaseEndpoint
*
*
* When {@code BackchannelAuthenticationRequestHandler.handle()} method raises a {@link
- * WebApplicationException}, this method calls {@link #onError(WebApplicationException)
- * onError()} method with the exception. The default implementation of {@code onError()}
+ * WebApplicationException}, this method calls {@link #onError(WebApplicationException) onError()}
+ * method with the exception. The default implementation of {@code onError()}
* does nothing. You can override the method as necessary. After calling
* {@code onError()} method, this method calls {@code getResponse()} method of
* the exception and uses the returned value as a response from this method.
@@ -71,20 +107,36 @@ public class BaseBackchannelAuthenticationEndpoint extends BaseEndpoint
* The certificate path used in mutual TLS authentication, in PEM format. The
* client's own certificate is the first in this array. Can be {@code null}.
*
+ * @param bcAuthOptions
+ * Request options for the {@code /api/backchannel/authentication} API.
+ *
+ * @param bcAuthIssueOptions
+ * Request options for the {@code /api/backchannel/authentication/issue} API.
+ *
+ * @param bcAuthFailOptions
+ * Request options for the {@code /api/backchannel/authentication/fail} API.
+ *
* @return
* A response that should be returned to the client application.
+ *
+ * @since 2.82
*/
public Response handle(
AuthleteApi api, BackchannelAuthenticationRequestHandlerSpi spi,
- MultivaluedMap parameters, String authorization, String[] clientCertificatePath)
+ MultivaluedMap parameters, String authorization,
+ String[] clientCertificatePath, Options bcAuthOptions, Options bcAuthIssueOptions,
+ Options bcAuthFailOptions)
{
try
{
// Create a handler.
- BackchannelAuthenticationRequestHandler handler = new BackchannelAuthenticationRequestHandler(api, spi);
+ BackchannelAuthenticationRequestHandler handler =
+ new BackchannelAuthenticationRequestHandler(api, spi);
// Delegate the task to the handler.
- return handler.handle(parameters, authorization, clientCertificatePath);
+ return handler.handle(
+ parameters, authorization, clientCertificatePath, bcAuthOptions,
+ bcAuthIssueOptions, bcAuthFailOptions);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseClientRegistrationEndpoint.java b/src/main/java/com/authlete/jakarta/BaseClientRegistrationEndpoint.java
index 890bd2a..46e3341 100644
--- a/src/main/java/com/authlete/jakarta/BaseClientRegistrationEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseClientRegistrationEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 Authlete, Inc.
+ * Copyright (C) 2019-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
/**
@@ -37,21 +38,48 @@
*/
public class BaseClientRegistrationEndpoint extends BaseEndpoint
{
+ /**
+ * Handle a client registration request. This method is an alias of {@link
+ * #handleGet(AuthleteApi, String, String, Options) handleRegister}{@code
+ * (api, json, authorization, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param json
+ * The serialized JSON body of the client registration request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the registration request.
+ * This is optional.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ */
+ public Response handleRegister(
+ AuthleteApi api,
+ String json,
+ String authorization)
+ {
+ return handleRegister(api, json, authorization, null);
+ }
+
+
/**
* Handle a client registration request.
*
*
* This method internally creates a {@link ClientRegistrationRequestHandler}
* instance and calls its
- * {@link ClientRegistrationRequestHandler#handleRegister(String, String)}
+ * {@link ClientRegistrationRequestHandler#handleRegister(String, String, Options)}
* method. Then, this method uses the value returned from the {@code handle()}
* method as a response from this method.
*
*
*
* When {@code ClientRegistrationRequestHandler.handle()} method raises a {@link
- * WebApplicationException}, this method calls {@link #onError(WebApplicationException)
- * onError()} method with the exception. The default implementation of {@code onError()}
+ * WebApplicationException}, this method calls {@link #onError(WebApplicationException) onError()}
+ * method with the exception. The default implementation of {@code onError()}
* does nothing. You can override the method as necessary. After calling
* {@code onError()} method, this method calls {@code getResponse()} method of
* the exception and uses the returned value as a response from this method.
@@ -67,19 +95,25 @@ public class BaseClientRegistrationEndpoint extends BaseEndpoint
* The value of {@code Authorization} header of the registration request.
* This is optional.
*
+ * @param options
+ * Request options for the {@code /api/client/registration} API.
+ *
* @return
* A response that should be returned to the client application.
+ *
+ * @since 2.82
*/
public Response handleRegister(
AuthleteApi api,
String json,
- String authorization)
+ String authorization,
+ Options options)
{
try
{
ClientRegistrationRequestHandler handler = new ClientRegistrationRequestHandler(api);
- return handler.handleRegister(json, authorization);
+ return handler.handleRegister(json, authorization, options);
}
catch (WebApplicationException e)
{
@@ -90,13 +124,43 @@ public Response handleRegister(
}
+ /**
+ * Handle a client registration management get request. This method is an alias
+ * of {@link #handleGet(AuthleteApi, String, String, Options) handle}{@code
+ * (api, clientId, authorization, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param clientId
+ * The client ID as determined by the incoming request. You will
+ * commonly parse this from the incoming request URL as a path
+ * component. If your Service has its {@code registrationManagementEndpoint}
+ * property set, Authlete will add the client ID as a path parameter
+ * to this URI automatically.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the registration request.
+ * This is optional.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ */
+ public Response handleGet(
+ AuthleteApi api,
+ String clientId,
+ String authorization)
+ {
+ return handleGet(api, clientId, authorization, null);
+ }
+
+
/**
* Handle a client registration management get request.
*
*
* This method internally creates a {@link ClientRegistrationRequestHandler}
- * instance and calls its
- * {@link ClientRegistrationRequestHandler#handleGet(String, String)}
+ * instance and calls its {@link ClientRegistrationRequestHandler#handleGet(String, String, Options)}
* method. Then, this method uses the value returned from the {@code handle()}
* method as a response from this method.
*
@@ -124,19 +188,25 @@ public Response handleRegister(
* The value of {@code Authorization} header of the registration request.
* This is optional.
*
+ * @param options
+ * Request options for the {@code /api/client/registration} API.
+ *
* @return
* A response that should be returned to the client application.
+ *
+ * @since 2.82
*/
public Response handleGet(
AuthleteApi api,
String clientId,
- String authorization)
+ String authorization,
+ Options options)
{
try
{
ClientRegistrationRequestHandler handler = new ClientRegistrationRequestHandler(api);
- return handler.handleGet(clientId, authorization);
+ return handler.handleGet(clientId, authorization, options);
}
catch (WebApplicationException e)
{
@@ -147,6 +217,41 @@ public Response handleGet(
}
+ /**
+ * Handle a client registration management update request. This method is an
+ * alias of the {@link #handleUpdate(AuthleteApi, String, String, String, Options)
+ * handleUpdate}{@code (api, clientId, json, authorization, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param clientId
+ * The client ID as determined by the incoming request. You will
+ * commonly parse this from the incoming request URL as a path
+ * component. If your Service has its {@code registrationManagementEndpoint}
+ * property set, Authlete will add the client ID as a path parameter
+ * to this URI automatically.
+ *
+ * @param json
+ * The serialized JSON body of the client update request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the registration request.
+ * This is optional.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ */
+ public Response handleUpdate(
+ AuthleteApi api,
+ String clientId,
+ String json,
+ String authorization)
+ {
+ return handleUpdate(api, clientId, json, authorization, null);
+ }
+
+
/**
* Handle a client registration management update request.
*
@@ -184,20 +289,26 @@ public Response handleGet(
* The value of {@code Authorization} header of the registration request.
* This is optional.
*
+ * @param options
+ * Request options for the {@code /api/client/registration} API.
+ *
* @return
* A response that should be returned to the client application.
+ *
+ * @since 2.82
*/
public Response handleUpdate(
AuthleteApi api,
String clientId,
String json,
- String authorization)
+ String authorization,
+ Options options)
{
try
{
ClientRegistrationRequestHandler handler = new ClientRegistrationRequestHandler(api);
- return handler.handleUpdate(clientId, json, authorization);
+ return handler.handleUpdate(clientId, json, authorization, options);
}
catch (WebApplicationException e)
{
@@ -208,6 +319,37 @@ public Response handleUpdate(
}
+ /**
+ * Handle a client registration management delete request. This method is an
+ * alias of {@link #handleDelete(AuthleteApi, String, String, Options) handle}{@code
+ * (api, clientId, authorization, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param clientId
+ * The client ID as determined by the incoming request. You will
+ * commonly parse this from the incoming request URL as a path
+ * component. If your Service has its {@code registrationManagementEndpoint}
+ * property set, Authlete will add the client ID as a path parameter
+ * to this URI automatically.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the registration request.
+ * This is optional.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ */
+ public Response handleDelete(
+ AuthleteApi api,
+ String clientId,
+ String authorization)
+ {
+ return handleDelete(api, clientId, authorization, null);
+ }
+
+
/**
* Handle a client registration management delete request.
*
@@ -242,13 +384,19 @@ public Response handleUpdate(
* The value of {@code Authorization} header of the registration request.
* This is optional.
*
+ * @param options
+ * Request options for the {@code /api/client/registration} API.
+ *
* @return
* A response that should be returned to the client application.
+ *
+ * @since 2.82
*/
public Response handleDelete(
AuthleteApi api,
String clientId,
- String authorization)
+ String authorization,
+ Options options)
{
try
{
diff --git a/src/main/java/com/authlete/jakarta/BaseConfigurationEndpoint.java b/src/main/java/com/authlete/jakarta/BaseConfigurationEndpoint.java
index eab7b27..542a2dc 100644
--- a/src/main/java/com/authlete/jakarta/BaseConfigurationEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseConfigurationEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2022 Authlete, Inc.
+ * Copyright (C) 2016-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.ServiceConfigurationRequest;
@@ -71,33 +72,53 @@
*/
public class BaseConfigurationEndpoint extends BaseEndpoint
{
+ /**
+ * Handle a request for OpenID Provider configuration. This method is an alias
+ * of the {@link #handle(AuthleteApi, Options)} method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ */
+ public Response handle(AuthleteApi api)
+ {
+ return handle(api, (Options)null);
+ }
+
+
/**
* Handle a request for OpenID Provider configuration.
*
*
* This method internally creates a {@link ConfigurationRequestHandler}
- * instance and calls its {@link ConfigurationRequestHandler#handle()} method.
- * Then, this method uses the value returned from the {@code handle()} method
- * as a response from this method.
+ * instance and calls its {@link ConfigurationRequestHandler#handle(Options)}
+ * method. Then, this method uses the value returned from the {@code handle()}
+ * method as a response from this method.
*
*
*
* When {@code ConfigurationRequestHandler.handle()} method raises a {@link
- * WebApplicationException}, this method calls {@link #onError(WebApplicationException)
- * onError()} method with the exception. The default implementation of {@code onError()}
- * does nothing. You
- * can override the method as necessary. After calling {@code onError()} method,
- * this method calls {@code getResponse()} method of the exception and uses the
- * returned value as a response from this method.
+ * WebApplicationException}, this method calls {@link #onError(WebApplicationException) onError()}
+ * method with the exception. The default implementation of {@code onError()}
+ * does nothing. You can override the method as necessary. After calling {@code
+ * onError()} method, this method calls {@code getResponse()} method of the
+ * exception and uses the returned value as a response from this method.
*
*
* @param api
* An implementation of {@link AuthleteApi}.
*
+ * @param options
+ * Request options for the {@code /api/service/configuration} API.
+ *
* @return
* A response that should be returned to the client application.
+ *
+ * @since 2.82
*/
- public Response handle(AuthleteApi api)
+ public Response handle(AuthleteApi api, Options options)
{
try
{
@@ -105,7 +126,7 @@ public Response handle(AuthleteApi api)
ConfigurationRequestHandler handler = new ConfigurationRequestHandler(api);
// Delegate the task to the handler.
- return handler.handle();
+ return handler.handle(options);
}
catch (WebApplicationException e)
{
@@ -118,15 +139,36 @@ public Response handle(AuthleteApi api)
}
+ /**
+ * Handle a request for OpenID Provider configuration. This method is an alias
+ * of the {@link #handle(AuthleteApi, ServiceConfigurationRequest, Options)}
+ * method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param request
+ * Request parameters for Authlete's {@code /service/configuration} API.
+ *
+ * @return
+ * A response that should be returned from the discovery endpoint.
+ *
+ * @since 2.50
+ */
+ public Response handle(AuthleteApi api, ServiceConfigurationRequest request)
+ {
+ return handle(api, request, null);
+ }
+
+
/**
* Handle a request for OpenID Provider configuration.
*
*
* This method internally creates a {@link ConfigurationRequestHandler}
* instance and calls its
- * {@link ConfigurationRequestHandler#handle(ServiceConfigurationRequest)
- * handle}{@code (}{@link ServiceConfigurationRequest}{@code )} method.
- * Then, this method uses the value returned from the method as a response
+ * {@link ConfigurationRequestHandler#handle(ServiceConfigurationRequest, Options)}
+ * method. Then, this method uses the value returned from the method as a response
* from this method.
*
*
@@ -143,14 +185,19 @@ public Response handle(AuthleteApi api)
* An implementation of {@link AuthleteApi}.
*
* @param request
- * Request parameters for Authlete's {@code /service/configuration} API.
+ * Request parameters for Authlete's {@code /api/service/configuration}
+ * API.
+ *
+ * @param options
+ * Request options for the {@code /api/service/configuration} API.
*
* @return
* A response that should be returned from the discovery endpoint.
*
- * @since 2.50
+ * @since 2.82
*/
- public Response handle(AuthleteApi api, ServiceConfigurationRequest request)
+ public Response handle(
+ AuthleteApi api, ServiceConfigurationRequest request, Options options)
{
try
{
@@ -158,7 +205,7 @@ public Response handle(AuthleteApi api, ServiceConfigurationRequest request)
ConfigurationRequestHandler handler = new ConfigurationRequestHandler(api);
// Delegate the task to the handler.
- return handler.handle(request);
+ return handler.handle(request, options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseCredentialIssuerMetadataEndpoint.java b/src/main/java/com/authlete/jakarta/BaseCredentialIssuerMetadataEndpoint.java
index 81db836..9d4a332 100644
--- a/src/main/java/com/authlete/jakarta/BaseCredentialIssuerMetadataEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseCredentialIssuerMetadataEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 Authlete, Inc.
+ * Copyright (C) 2023-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.CredentialIssuerMetadataRequest;
@@ -54,24 +55,82 @@
*/
public class BaseCredentialIssuerMetadataEndpoint extends BaseEndpoint
{
+ /**
+ * Handle a request to the credential issuer metadata endpoint. This method is
+ * an alias of the {@link #handle(AuthleteApi, Options)} method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @return
+ * A response that should be returned from the credential issuer
+ * metadata endpoint.
+ */
+ public Response handle(AuthleteApi api)
+ {
+ return handle(api, (Options)null);
+ }
+
+
+ /**
+ * Handle a request to the credential issuer metadata endpoint. This method
+ * is an alias of the {@link #handle(AuthleteApi, CredentialIssuerMetadataRequest,
+ * Options)} method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param options
+ * Request options for the {@code /api/vci/metadata} API.
+ *
+ * @return
+ * A response that should be returned from the credential issuer
+ * metadata endpoint.
+ *
+ * @since 2.82
+ */
+ public Response handle(AuthleteApi api, Options options)
+ {
+ return handle(api, new CredentialIssuerMetadataRequest(), options);
+ }
+
+
+ /**
+ * Handle a request to the credential issuer metadata endpoint. This method
+ * is an alias of the {@link #handle(AuthleteApi, CredentialIssuerMetadataRequest,
+ * Options)} method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param request
+ * Request parameters for Authlete's {@code /api/vci/metadata} API.
+ *
+ * @return
+ * A response that should be returned from the credential issuer
+ * metadata endpoint.
+ */
+ public Response handle(AuthleteApi api, CredentialIssuerMetadataRequest request)
+ {
+ return handle(api, request, null);
+ }
+
+
/**
* Handle a request to the credential issuer metadata endpoint.
*
*
* This method internally creates a {@link CredentialIssuerMetadataRequestHandler}
- * instance and calls its {@link
- * CredentialIssuerMetadataRequestHandler#handle(CredentialIssuerMetadataRequest)
- * handle}({@link CredentialIssuerMetadataRequest})
method.
- * Then, this method uses the value returned from the handler's method as a
- * response from this method.
+ * instance and calls its {@link CredentialIssuerMetadataRequestHandler#handle(CredentialIssuerMetadataRequest,
+ * Options)} method. Then, this method uses the value returned from the handler's
+ * method as a response from this method.
*
*
*
* When the handler's method raises a {@link WebApplicationException}, this
- * method calls {@link #onError(WebApplicationException)
- * onError(WebApplicationException)} method with the exception. The default
- * implementation of {@code onError()} does nothing. You can override the
- * method as necessary. After calling {@code onError()} method, this method
+ * method calls {@link #onError(WebApplicationException) onError()} method with the exception.
+ * The default implementation of {@code onError()} does nothing. You can override
+ * the method as necessary. After calling {@code onError()} method, this method
* calls {@code getResponse()} method of the exception and uses the returned
* value as a response from this method.
*
@@ -79,11 +138,20 @@ public class BaseCredentialIssuerMetadataEndpoint extends BaseEndpoint
* @param api
* An implementation of {@link AuthleteApi}.
*
+ * @param request
+ * Request parameters for Authlete's {@code /api/vci/metadata} API.
+ *
+ * @param options
+ * Request options for the {@code /api/vci/metadata} API.
+ *
* @return
* A response that should be returned from the credential issuer
* metadata endpoint.
+ *
+ * @since 2.82
*/
- public Response handle(AuthleteApi api, CredentialIssuerMetadataRequest request)
+ public Response handle(
+ AuthleteApi api, CredentialIssuerMetadataRequest request, Options options)
{
try
{
@@ -92,7 +160,7 @@ public Response handle(AuthleteApi api, CredentialIssuerMetadataRequest request)
new CredentialIssuerMetadataRequestHandler(api);
// Delegate the task to the handler.
- return handler.handle(request);
+ return handler.handle(request, options);
}
catch (WebApplicationException e)
{
@@ -103,26 +171,4 @@ public Response handle(AuthleteApi api, CredentialIssuerMetadataRequest request)
return e.getResponse();
}
}
-
-
- /**
- * Handle a request to the credential issuer metadata endpoint.
- *
- *
- * This method is an alias of {@link
- * #handle(AuthleteApi, CredentialIssuerMetadataRequest)
- * handle}{@code (api, new CredentialIssuerMetadataRequest())}
- *
- *
- * @param api
- * An implementation of {@link AuthleteApi}.
- *
- * @return
- * A response that should be returned from the credential issuer
- * metadata endpoint.
- */
- public Response handle(AuthleteApi api)
- {
- return handle(api, new CredentialIssuerMetadataRequest());
- }
}
diff --git a/src/main/java/com/authlete/jakarta/BaseCredentialJwtIssuerMetadataEndpoint.java b/src/main/java/com/authlete/jakarta/BaseCredentialJwtIssuerMetadataEndpoint.java
index 622854c..554716b 100644
--- a/src/main/java/com/authlete/jakarta/BaseCredentialJwtIssuerMetadataEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseCredentialJwtIssuerMetadataEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 Authlete, Inc.
+ * Copyright (C) 2023-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.CredentialJwtIssuerMetadataRequest;
@@ -50,24 +51,80 @@
*/
public class BaseCredentialJwtIssuerMetadataEndpoint extends BaseEndpoint
{
+ /**
+ * Handle a request to the JWT issuer metadata endpoint. This method is an alias
+ * of {@link #handle(AuthleteApi, CredentialJwtIssuerMetadataRequest)} method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @return
+ * A response that should be returned from the JWT issuer
+ * metadata endpoint.
+ */
+ public Response handle(AuthleteApi api)
+ {
+ return handle(api, new CredentialJwtIssuerMetadataRequest());
+ }
+
+
+ /**
+ * Handle a request to the JWT issuer metadata endpoint. This method is an alias
+ * of {@link #handle(AuthleteApi, CredentialJwtIssuerMetadataRequest, Options)}
+ * method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param options
+ * Request options for the {@code /api/vci/jwtissuer} API.
+ *
+ * @return
+ * A response that should be returned from the JWT issuer
+ * metadata endpoint.
+ *
+ * @since 2.82
+ */
+ public Response handle(AuthleteApi api, Options options)
+ {
+ return handle(api, new CredentialJwtIssuerMetadataRequest(), options);
+ }
+
+
+ /**
+ * Handle a request to the JWT issuer metadata endpoint. This method is an alias
+ * of {@link #handle(AuthleteApi, CredentialJwtIssuerMetadataRequest, CredentialJwtIssuerMetadataRequest,
+ * Options)} method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @return
+ * A response that should be returned from the JWT issuer
+ * metadata endpoint.
+ */
+ public Response handle(AuthleteApi api, CredentialJwtIssuerMetadataRequest request)
+ {
+ return handle(api, request, null);
+ }
+
+
/**
* Handle a request to the JWT issuer metadata endpoint.
*
*
- * This method internally creates a {@link
- * CredentialJwtIssuerMetadataRequestHandler} instance and calls its {@link
- * CredentialJwtIssuerMetadataRequestHandler#handle(CredentialJwtIssuerMetadataRequest)
- * handle}({@link CredentialJwtIssuerMetadataRequest})
method.
- * Then, this method uses the value returned from the handler's method as a
- * response from this method.
+ * This method internally creates a {@link CredentialJwtIssuerMetadataRequestHandler}
+ * instance and calls its {@link
+ * CredentialJwtIssuerMetadataRequestHandler#handle(CredentialJwtIssuerMetadataRequest, Options)}
+ * method. Then, this method uses the value returned from the handler's method
+ * as a response from this method.
*
*
*
* When the handler's method raises a {@link WebApplicationException}, this
- * method calls {@link #onError(WebApplicationException)
- * onError(WebApplicationException)} method with the exception. The default
- * implementation of {@code onError()} does nothing. You can override the
- * method as necessary. After calling {@code onError()} method, this method
+ * method calls {@link #onError(WebApplicationException) onError()} method with the exception.
+ * The default implementation of {@code onError()} does nothing. You can override
+ * the method as necessary. After calling {@code onError()} method, this method
* calls {@code getResponse()} method of the exception and uses the returned
* value as a response from this method.
*
@@ -75,11 +132,20 @@ public class BaseCredentialJwtIssuerMetadataEndpoint extends BaseEndpoint
* @param api
* An implementation of {@link AuthleteApi}.
*
+ * @param request
+ * Request parameters for Authlete's {@code /api/vci/jwtissuer} API.
+ *
+ * @param options
+ * Request options for the {@code /api/vci/jwtissuer} API.
+ *
* @return
* A response that should be returned from the JWT issuer
* metadata endpoint.
+ *
+ * @since 2.82
*/
- public Response handle(AuthleteApi api, CredentialJwtIssuerMetadataRequest request)
+ public Response handle(
+ AuthleteApi api, CredentialJwtIssuerMetadataRequest request, Options options)
{
try
{
@@ -88,7 +154,7 @@ public Response handle(AuthleteApi api, CredentialJwtIssuerMetadataRequest reque
new CredentialJwtIssuerMetadataRequestHandler(api);
// Delegate the task to the handler.
- return handler.handle(request);
+ return handler.handle(request, options);
}
catch (WebApplicationException e)
{
@@ -99,26 +165,4 @@ public Response handle(AuthleteApi api, CredentialJwtIssuerMetadataRequest reque
return e.getResponse();
}
}
-
-
- /**
- * Handle a request to the JWT issuer metadata endpoint.
- *
- *
- * This method is an alias of {@link
- * #handle(AuthleteApi, CredentialJwtIssuerMetadataRequest)
- * handle}{@code (api, new CredentialJwtIssuerMetadataRequest())}
- *
- *
- * @param api
- * An implementation of {@link AuthleteApi}.
- *
- * @return
- * A response that should be returned from the JWT issuer
- * metadata endpoint.
- */
- public Response handle(AuthleteApi api)
- {
- return handle(api, new CredentialJwtIssuerMetadataRequest());
- }
}
diff --git a/src/main/java/com/authlete/jakarta/BaseCredentialOfferUriEndpoint.java b/src/main/java/com/authlete/jakarta/BaseCredentialOfferUriEndpoint.java
index 4b2bf14..36ffeef 100644
--- a/src/main/java/com/authlete/jakarta/BaseCredentialOfferUriEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseCredentialOfferUriEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2023 Authlete, Inc.
+ * Copyright (C) 2016-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,12 +20,20 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.CredentialOfferInfoRequest;
public class BaseCredentialOfferUriEndpoint extends BaseEndpoint
{
public Response handle(final AuthleteApi api, final CredentialOfferInfoRequest request)
+ {
+ return handle(api, request, null);
+ }
+
+
+ public Response handle(
+ final AuthleteApi api, final CredentialOfferInfoRequest request, Options options)
{
try
{
@@ -33,7 +41,7 @@ public Response handle(final AuthleteApi api, final CredentialOfferInfoRequest r
CredentialOfferUriRequestHandler handler = new CredentialOfferUriRequestHandler(api);
// Delegate the task to the handler.
- return handler.handle(request);
+ return handler.handle(request, options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseDeviceAuthorizationEndpoint.java b/src/main/java/com/authlete/jakarta/BaseDeviceAuthorizationEndpoint.java
index e1ad99b..13d9ce0 100644
--- a/src/main/java/com/authlete/jakarta/BaseDeviceAuthorizationEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseDeviceAuthorizationEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 Authlete, Inc.
+ * Copyright (C) 2019-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
/**
@@ -32,12 +33,47 @@
*/
public class BaseDeviceAuthorizationEndpoint extends BaseEndpoint
{
+ /**
+ * Handle a device authorization request. This method is an alias of {@link
+ * #handle(AuthleteApi, MultivaluedMap, String, String[], Options) handle}{@code
+ * (api, parameters, authorization, clientCertificatePath, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param spi
+ * An implementation of {@link DeviceAuthorizationRequestHandlerSpi}.
+ *
+ * @param parameters
+ * Request parameters of the device authorization request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the device authorization
+ * request.
+ *
+ * @param clientCertificatePath
+ * The certificate path used in mutual TLS authentication, in PEM format.
+ * The client's own certificate is the first in this array. Can be
+ * {@code null}.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ */
+ public Response handle(
+ AuthleteApi api, MultivaluedMap parameters, String authorization,
+ String[] clientCertificatePath)
+ {
+ return handle(api, parameters, authorization, clientCertificatePath, null);
+ }
+
+
/**
* Handle a device authorization request.
*
*
* This method internally creates a {@link DeviceAuthorizationRequestHandler}
- * instance and calls its {@link DeviceAuthorizationRequestHandler#handle(MultivaluedMap, String, String[])}
+ * instance and calls its {@link
+ * DeviceAuthorizationRequestHandler#handle(MultivaluedMap, String, String[], Options)}
* method. Then, this method uses the value returned from the {@code handle()}
* method as a response from this method.
*
@@ -70,12 +106,17 @@ public class BaseDeviceAuthorizationEndpoint extends BaseEndpoint
* The client's own certificate is the first in this array. Can be
* {@code null}.
*
+ * @param options
+ * Request options for the {@code /api/device/authorization} API.
+ *
* @return
* A response that should be returned to the client application.
+ *
+ * @since 2.82
*/
public Response handle(
AuthleteApi api, MultivaluedMap parameters, String authorization,
- String[] clientCertificatePath)
+ String[] clientCertificatePath, Options options)
{
try
{
@@ -83,7 +124,7 @@ public Response handle(
DeviceAuthorizationRequestHandler handler = new DeviceAuthorizationRequestHandler(api);
// Delegate the task to the handler.
- return handler.handle(parameters, authorization, clientCertificatePath);
+ return handler.handle(parameters, authorization, clientCertificatePath, options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseDeviceCompleteEndpoint.java b/src/main/java/com/authlete/jakarta/BaseDeviceCompleteEndpoint.java
index a6ea4a6..faee98e 100644
--- a/src/main/java/com/authlete/jakarta/BaseDeviceCompleteEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseDeviceCompleteEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019-2022 Authlete, Inc.
+ * Copyright (C) 2019-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.jakarta.spi.DeviceCompleteRequestHandlerSpi;
@@ -33,14 +34,43 @@
*/
public class BaseDeviceCompleteEndpoint extends BaseEndpoint
{
+ /**
+ * Handle a device complete request. This method is an alias of {@link
+ * #handle(AuthleteApi, DeviceCompleteRequestHandlerSpi, String, String[], Options)}{@code
+ * (api, spi, userCode, claimNames, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param spi
+ * An implementation of {@link DeviceCompleteRequestHandlerSpi}.
+ *
+ * @param userCode
+ * The user code that the end-user input.
+ *
+ * @param claimNames
+ * Names of requested claims. Use the value of the {@code claimNames}
+ * parameter in a response from Authlete's {@code /api/device/verification} API.
+ *
+ * @return
+ * A response that should be returned to the end-user.
+ */
+ public Response handle(
+ AuthleteApi api, DeviceCompleteRequestHandlerSpi spi, String userCode,
+ String[] claimNames)
+ {
+ return handle(api, spi, userCode, claimNames, null);
+ }
+
+
/**
* Handle a device complete request.
*
*
* This method internally creates a {@link DeviceCompleteRequestHandler} instance and
- * calls its {@link DeviceCompleteRequestHandler#handle(String, String[])} method.
- * Then, this method uses the value returned from the {@code handle()} method
- * as a response from this method.
+ * calls its {@link DeviceCompleteRequestHandler#handle(String, String[], Options)}
+ * method. Then, this method uses the value returned from the {@code handle()}
+ * method as a response from this method.
*
*
*
@@ -65,12 +95,17 @@ public class BaseDeviceCompleteEndpoint extends BaseEndpoint
* Names of requested claims. Use the value of the {@code claimNames}
* parameter in a response from Authlete's {@code /api/device/verification} API.
*
+ * @param options
+ * Request options for the {@code /api/device/authorization/complete} API.
+ *
* @return
* A response that should be returned to the end-user.
+ *
+ * @since 2.82
*/
public Response handle(
AuthleteApi api, DeviceCompleteRequestHandlerSpi spi, String userCode,
- String[] claimNames)
+ String[] claimNames, Options options)
{
try
{
@@ -78,7 +113,7 @@ public Response handle(
DeviceCompleteRequestHandler handler = new DeviceCompleteRequestHandler(api, spi);
// Delegate the task to the handler.
- return handler.handle(userCode, claimNames);
+ return handler.handle(userCode, claimNames, options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseDeviceVerificationEndpoint.java b/src/main/java/com/authlete/jakarta/BaseDeviceVerificationEndpoint.java
index 94d2bd8..24ce3b8 100644
--- a/src/main/java/com/authlete/jakarta/BaseDeviceVerificationEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseDeviceVerificationEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 Authlete, Inc.
+ * Copyright (C) 2019-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.jakarta.spi.DeviceVerificationRequestHandlerSpi;
@@ -32,20 +33,39 @@
*/
public class BaseDeviceVerificationEndpoint extends BaseEndpoint
{
+ /**
+ * Handle a device verification request. This method is an alias of {@link
+ * #handle(AuthleteApi, DeviceVerificationRequestHandlerSpi, Options)} method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param spi
+ * An implementation of {@link DeviceVerificationRequestHandlerSpi}.
+ *
+ * @return
+ * A response that should be returned to the end-user.
+ */
+ public Response handle(AuthleteApi api, DeviceVerificationRequestHandlerSpi spi)
+ {
+ return handle(api, spi, null);
+ }
+
+
/**
* Handle a device verification request.
*
*
* This method internally creates a {@link DeviceVerificationRequestHandler}
- * instance and calls its {@link DeviceVerificationRequestHandler#handle()}
+ * instance and calls its {@link DeviceVerificationRequestHandler#handle(Options)}
* method. Then, this method uses the value returned from the {@code handle()}
* method as a response from this method.
*
*
*
* When {@code DeviceVerificationRequestHandler.handle()} method raises a {@link
- * WebApplicationException}, this method calls {@link #onError(WebApplicationException)
- * onError()} method with the exception. The default implementation of {@code onError()}
+ * WebApplicationException}, this method calls {@link #onError(WebApplicationException) onError()}
+ * method with the exception. The default implementation of {@code onError()}
* does nothing. You can override the method as necessary. After calling
* {@code onError()} method, this method calls {@code getResponse()} method of
* the exception and uses the returned value as a response from this method.
@@ -57,10 +77,16 @@ public class BaseDeviceVerificationEndpoint extends BaseEndpoint
* @param spi
* An implementation of {@link DeviceVerificationRequestHandlerSpi}.
*
+ * @param options
+ * Request options for the {@code /api/device/authorization/verification} API.
+ *
* @return
* A response that should be returned to the end-user.
+ *
+ * @since 2.82
*/
- public Response handle(AuthleteApi api, DeviceVerificationRequestHandlerSpi spi)
+ public Response handle(
+ AuthleteApi api, DeviceVerificationRequestHandlerSpi spi, Options options)
{
try
{
@@ -68,7 +94,7 @@ public Response handle(AuthleteApi api, DeviceVerificationRequestHandlerSpi spi)
DeviceVerificationRequestHandler handler = new DeviceVerificationRequestHandler(api, spi);
// Delegate the task to the handler.
- return handler.handle();
+ return handler.handle(options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseFederationConfigurationEndpoint.java b/src/main/java/com/authlete/jakarta/BaseFederationConfigurationEndpoint.java
index 916e2eb..6576605 100644
--- a/src/main/java/com/authlete/jakarta/BaseFederationConfigurationEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseFederationConfigurationEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 Authlete, Inc.
+ * Copyright (C) 2022-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.FederationConfigurationRequest;
@@ -57,23 +58,82 @@
*/
public class BaseFederationConfigurationEndpoint extends BaseEndpoint
{
+ /**
+ * Handle a request to the entity configuration endpoint. This method is an alias
+ * of {@link #handle(AuthleteApi, FederationConfigurationRequest)} method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @return
+ * A response that should be returned from the entity configuration
+ * endpoint.
+ */
+ public Response handle(AuthleteApi api)
+ {
+ return handle(api, new FederationConfigurationRequest());
+ }
+
+
+ /**
+ * Handle a request to the entity configuration endpoint. This method is an
+ * alias of {@link #handle(AuthleteApi, FederationConfigurationRequest, Options)}
+ * method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param options
+ * Request options for the {@code /api/federation/configuration} API.
+ *
+ * @return
+ * A response that should be returned from the entity configuration
+ * endpoint.
+ *
+ * @since 2.82
+ */
+ public Response handle(AuthleteApi api, Options options)
+ {
+ return handle(api, new FederationConfigurationRequest(), null);
+ }
+
+
+ /**
+ * Handle a request to the entity configuration endpoint. This method is an
+ * alias of {@link #handle(AuthleteApi, FederationConfigurationRequest, Options)
+ * handle}{@code (api, request, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param request
+ * Request parameters for Authlete's {@code /api/federation/configuration} API.
+ *
+ * @return
+ * A response that should be returned from the entity configuration
+ * endpoint.
+ */
+ public Response handle(AuthleteApi api, FederationConfigurationRequest request)
+ {
+ return handle(api, request, null);
+ }
+
+
/**
* Handle a request to the entity configuration endpoint.
*
*
* This method internally creates a {@link FederationConfigurationRequestHandler}
* instance and calls its {@link
- * FederationConfigurationRequestHandler#handle(FederationConfigurationRequest)
- * handle}({@link FederationConfigurationRequest})
method.
- * Then, this method uses the value returned from the handler's method as a
- * response from this method.
+ * FederationConfigurationRequestHandler#handle(FederationConfigurationRequest, Options)}
+ * method. Then, this method uses the value returned from the handler's method
+ * as a response from this method.
*
*
*
* When the handler's method raises a {@link WebApplicationException}, this
- * method calls {@link #onError(WebApplicationException)
- * onError(WebApplicationException)} method with the exception. The default
- * implementation of {@code onError()} does nothing. You can override the
+ * method calls {@link #onError(WebApplicationException) onError()} method with the exception.
+ * The default implementation of {@code onError()} does nothing. You can override the
* method as necessary. After calling {@code onError()} method, this method
* calls {@code getResponse()} method of the exception and uses the returned
* value as a response from this method.
@@ -82,11 +142,20 @@ public class BaseFederationConfigurationEndpoint extends BaseEndpoint
* @param api
* An implementation of {@link AuthleteApi}.
*
+ * @param request
+ * Request parameters for Authlete's {@code /api/federation/configuration} API.
+ *
+ * @param options
+ * Request options for the {@code /api/federation/configuration} API.
+ *
* @return
* A response that should be returned from the entity configuration
* endpoint.
+ *
+ * @since 2.82
*/
- public Response handle(AuthleteApi api, FederationConfigurationRequest request)
+ public Response handle(
+ AuthleteApi api, FederationConfigurationRequest request, Options options)
{
try
{
@@ -95,7 +164,7 @@ public Response handle(AuthleteApi api, FederationConfigurationRequest request)
new FederationConfigurationRequestHandler(api);
// Delegate the task to the handler.
- return handler.handle(request);
+ return handler.handle(request, options);
}
catch (WebApplicationException e)
{
@@ -106,26 +175,4 @@ public Response handle(AuthleteApi api, FederationConfigurationRequest request)
return e.getResponse();
}
}
-
-
- /**
- * Handle a request to the entity configuration endpoint.
- *
- *
- * This method is an alias of {@link
- * #handle(AuthleteApi, FederationConfigurationRequest)
- * handle}{@code (api, new FederationConfigurationRequest())}
- *
- *
- * @param api
- * An implementation of {@link AuthleteApi}.
- *
- * @return
- * A response that should be returned from the entity configuration
- * endpoint.
- */
- public Response handle(AuthleteApi api)
- {
- return handle(api, new FederationConfigurationRequest());
- }
}
diff --git a/src/main/java/com/authlete/jakarta/BaseFederationRegistrationEndpoint.java b/src/main/java/com/authlete/jakarta/BaseFederationRegistrationEndpoint.java
index f1eb7ce..ff3895e 100644
--- a/src/main/java/com/authlete/jakarta/BaseFederationRegistrationEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseFederationRegistrationEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 Authlete, Inc.
+ * Copyright (C) 2022-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.FederationRegistrationRequest;
@@ -80,36 +81,63 @@
*/
public class BaseFederationRegistrationEndpoint extends BaseEndpoint
{
+ /**
+ * Handle a request to the federation registration endpoint. This method is an alias
+ * of {@link #handle(AuthleteApi, FederationRegistrationRequest, Options)} method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param request
+ * Request parameters for Authlete's {@code /api/federation/registration} API.
+ *
+ * @return
+ * A response that should be returned from the federation
+ * registration endpoint.
+ */
+ public Response handle(AuthleteApi api, FederationRegistrationRequest request)
+ {
+ return handle(api, request, null);
+ }
+
+
/**
* Handle a request to the federation registration endpoint.
*
*
* This method internally creates a {@link FederationRegistrationRequestHandler}
* instance and calls its {@link
- * FederationRegistrationRequestHandler#handle(FederationRegistrationRequest)
- * handle}({@link FederationRegistrationRequest})
method.
- * Then, this method uses the value returned from the handler's method as a
- * response from this method.
+ * FederationRegistrationRequestHandler#handle(FederationRegistrationRequest, Options)}
+ * method. Then, this method uses the value returned from the handler's method
+ * as a response from this method.
*
*
*
* When the handler's method raises a {@link WebApplicationException}, this
- * method calls {@link #onError(WebApplicationException)
- * onError(WebApplicationException)} method with the exception. The default
- * implementation of {@code onError()} does nothing. You can override the
- * method as necessary. After calling {@code onError()} method, this method
- * calls {@code getResponse()} method of the exception and uses the returned
- * value as a response from this method.
+ * method calls {@link #onError(WebApplicationException) onError()} method with
+ * the exception. The default implementation of {@code onError()} does nothing.
+ * You can override the method as necessary. After calling {@code onError()}
+ * method, this method calls {@code getResponse()} method of the exception and
+ * uses the returned value as a response from this method.
*
*
* @param api
* An implementation of {@link AuthleteApi}.
*
+ * @param request
+ * Request parameters for Authlete's {@code /api/federation/registration} API.
+ *
+ * @param options
+ * Request options for the {@code /api/federation/configuration} API.
+ *
* @return
* A response that should be returned from the federation
* registration endpoint.
+ *
+ * @since 2.82
*/
- public Response handle(AuthleteApi api, FederationRegistrationRequest request)
+ public Response handle(
+ AuthleteApi api, FederationRegistrationRequest request, Options options)
{
try
{
@@ -118,7 +146,7 @@ public Response handle(AuthleteApi api, FederationRegistrationRequest request)
new FederationRegistrationRequestHandler(api);
// Delegate the task to the handler.
- return handler.handle(request);
+ return handler.handle(request, options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseGrantManagementEndpoint.java b/src/main/java/com/authlete/jakarta/BaseGrantManagementEndpoint.java
index c9e46ea..e36f97d 100644
--- a/src/main/java/com/authlete/jakarta/BaseGrantManagementEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseGrantManagementEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 Authlete, Inc.
+ * Copyright (C) 2021-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
import jakarta.ws.rs.core.HttpHeaders;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.GMRequest;
import com.authlete.common.types.GMAction;
@@ -36,13 +37,41 @@
*/
public class BaseGrantManagementEndpoint extends BaseResourceEndpoint
{
+ /**
+ * Handle a grant management request. This method is an alias of {@link
+ * #handle(AuthleteApi, HttpServletRequest, String, Options)}{@code
+ * (api, req, grantId, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param req
+ * An HTTP request that the grant management endpoint received.
+ * Its HTTP method must be either {@code GET} or {@code DELETE}.
+ *
+ * @param grantId
+ * The grant ID included in the API call to the grant management
+ * endpoint. The last part of the path of the URL.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ *
+ * @throws WebApplicationException
+ * An exception generated by {@link GMRequestHandler}.
+ */
+ public Response handle(
+ AuthleteApi api, HttpServletRequest req, String grantId) throws WebApplicationException
+ {
+ return handle(api, req, grantId, null);
+ }
+
+
/**
* Handle a grant management request.
*
*
* This method internally creates a {@link GMRequestHandler} instance and
- * calls its {@link GMRequestHandler#handle(GMRequest) handle}(
{@link
- * GMRequest})
method.
+ * calls its {@link GMRequestHandler#handle(GMRequest, Options)} method.
*
*
* @param api
@@ -56,15 +85,19 @@ public class BaseGrantManagementEndpoint extends BaseResourceEndpoint
* The grant ID included in the API call to the grant management
* endpoint. The last part of the path of the URL.
*
+ * @param options
+ * Request options for the {@code /api/gm} API.
+ *
* @return
* A response that should be returned to the client application.
*
* @throws WebApplicationException
* An exception generated by {@link GMRequestHandler}.
+ *
+ * @since 2.82
*/
public Response handle(
- AuthleteApi api, HttpServletRequest req, String grantId)
- throws WebApplicationException
+ AuthleteApi api, HttpServletRequest req, String grantId, Options options) throws WebApplicationException
{
// Construct request parameters for an API call to the /api/gm API.
GMRequest request = buildRequest(req, grantId);
@@ -73,7 +106,7 @@ public Response handle(
GMRequestHandler handler = new GMRequestHandler(api);
// Call the /api/gm API and handle the response.
- return handler.handle(request);
+ return handler.handle(request, options);
}
diff --git a/src/main/java/com/authlete/jakarta/BaseIntrospectionEndpoint.java b/src/main/java/com/authlete/jakarta/BaseIntrospectionEndpoint.java
index b3bb9d3..e775fb0 100644
--- a/src/main/java/com/authlete/jakarta/BaseIntrospectionEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseIntrospectionEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017-2023 Authlete, Inc.
+ * Copyright (C) 2017-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.jakarta.IntrospectionRequestHandler.Params;
@@ -39,10 +40,8 @@
public class BaseIntrospectionEndpoint extends BaseEndpoint
{
/**
- * Handle an introspection request.
- *
- * This method is an alias of the {@link #handle(AuthleteApi,
- * IntrospectionRequestHandler.Params)} method.
+ * Handle an introspection request. This method is an alias of {@link
+ * #handle(AuthleteApi, MultivaluedMap, Options) handle}{@code (api, parameters, null)}.
*
* @param api
* An implementation of {@link AuthleteApi}.
@@ -54,6 +53,31 @@ public class BaseIntrospectionEndpoint extends BaseEndpoint
* A response that should be returned to the resource server.
*/
public Response handle(AuthleteApi api, MultivaluedMap parameters)
+ {
+ return handle(api, parameters, null);
+ }
+
+
+ /**
+ * Handle an introspection request. This method is an alias of the {@link
+ * #handle(AuthleteApi, IntrospectionRequestHandler.Params, Options)} method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param parameters
+ * Request parameters of an introspection request.
+ *
+ * @param options
+ * Request options for the {@code /api/auth/introspection} API.
+ *
+ * @return
+ * A response that should be returned to the resource server.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ AuthleteApi api, MultivaluedMap parameters, Options options)
{
Params params = new Params()
.setParameters(parameters)
@@ -63,13 +87,36 @@ public Response handle(AuthleteApi api, MultivaluedMap parameter
}
+ /**
+ * Handle an introspection request. This method is an alias of {@link
+ * #handle(AuthleteApi, IntrospectionRequestHandler.Params, Options)
+ * handle}{@code (api, params, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param params
+ * Parameters needed to handle the introspection request.
+ *
+ * @return
+ * A response that should be returned to the resource server.
+ *
+ * @since 2.63
+ */
+ public Response handle(AuthleteApi api, Params params)
+ {
+ return handle(api, params, null);
+ }
+
+
/**
* Handle an introspection request.
*
*
* This method internally creates an {@link IntrospectionRequestHandler}
- * instance and calls its {@link IntrospectionRequestHandler#handle(IntrospectionRequestHandler.Params)
- * handle()} method with the {@code params} argument. Then, this
+ * instance and calls its {@link
+ * IntrospectionRequestHandler#handle(IntrospectionRequestHandler.Params, Options)}
+ * method with the {@code params} argument. Then, this
* method uses the value returned from the {@code handle()} method
* as a response from this method.
*
@@ -91,12 +138,15 @@ public Response handle(AuthleteApi api, MultivaluedMap parameter
* @param params
* Parameters needed to handle the introspection request.
*
+ * @param options
+ * Request options for the {@code /api/auth/introspection} API.
+ *
* @return
* A response that should be returned to the resource server.
*
- * @since 2.63
+ * @since 2.82
*/
- public Response handle(AuthleteApi api, Params params)
+ public Response handle(AuthleteApi api, Params params, Options options)
{
try
{
@@ -104,7 +154,7 @@ public Response handle(AuthleteApi api, Params params)
IntrospectionRequestHandler handler = new IntrospectionRequestHandler(api);
// Delegate the task to the handler.
- return handler.handle(params);
+ return handler.handle(params, options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseJwksEndpoint.java b/src/main/java/com/authlete/jakarta/BaseJwksEndpoint.java
index 7e4fc71..c082f42 100644
--- a/src/main/java/com/authlete/jakarta/BaseJwksEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseJwksEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2020 Authlete, Inc.
+ * Copyright (C) 2016-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
/**
@@ -51,6 +52,22 @@
*/
public class BaseJwksEndpoint extends BaseEndpoint
{
+ /**
+ * Handle a request for a JWK Set document. This method is an alias of {@link
+ * #handle(AuthleteApi, Options) handle}{@code (api, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ */
+ public Response handle(AuthleteApi api)
+ {
+ return handle(api, null);
+ }
+
+
/**
* Handle a request for a JWK Set document.
*
@@ -63,8 +80,8 @@ public class BaseJwksEndpoint extends BaseEndpoint
*
*
* When {@code JwksRequestHandler.handle()} method raises a {@link
- * WebApplicationException}, this method calls {@link #onError(WebApplicationException)
- * onError()} method with the exception. The default implementation of {@code onError()}
+ * WebApplicationException}, this method calls {@link #onError(WebApplicationException) onError()}
+ * method with the exception. The default implementation of {@code onError()}
* does nothing. You
* can override the method as necessary. After calling {@code onError()} method,
* this method calls {@code getResponse()} method of the exception and uses the
@@ -74,10 +91,15 @@ public class BaseJwksEndpoint extends BaseEndpoint
* @param api
* An implementation of {@link AuthleteApi}.
*
+ * @param options
+ * Request options for the {@code /api/service/jwks/get} API.
+ *
* @return
* A response that should be returned to the client application.
+ *
+ * @since 2.82
*/
- public Response handle(AuthleteApi api)
+ public Response handle(AuthleteApi api, Options options)
{
try
{
@@ -85,7 +107,7 @@ public Response handle(AuthleteApi api)
JwksRequestHandler handler = new JwksRequestHandler(api);
// Delegate the task to the handler.
- return handler.handle();
+ return handler.handle(options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BasePushedAuthReqEndpoint.java b/src/main/java/com/authlete/jakarta/BasePushedAuthReqEndpoint.java
index 265ffaa..2aef04c 100644
--- a/src/main/java/com/authlete/jakarta/BasePushedAuthReqEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BasePushedAuthReqEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019-2023 Authlete, Inc.
+ * Copyright (C) 2019-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.jakarta.PushedAuthReqHandler.Params;
@@ -37,23 +38,37 @@
public class BasePushedAuthReqEndpoint extends BaseEndpoint
{
/**
- * Handle a pushed authorization request.
+ * Handle a pushed authorization request. This method is an alias of {@link
+ * #handle(AuthleteApi, MultivaluedMap, String, String[], Options) handle}{@code
+ * (api, parameters, authorization, clientCertificates, null)}.
*
- *
- * This method internally creates a {@link PushedAuthReqHandler} instance
- * and calls its {@link PushedAuthReqHandler#handle(MultivaluedMap, String, String[])}
- * method. Then, this method uses the value returned from the {@code handle()}
- * method as a response from this method.
- *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
*
- *
- * When {@code PushedAuthReqHandler.handle()} method raises a {@link
- * WebApplicationException}, this method calls {@link #onError(WebApplicationException)
- * onError()} method with the exception. The default implementation of {@code onError()}
- * does nothing. You can override the method as necessary. After calling
- * {@code onError()} method, this method calls {@code getResponse()} method of
- * the exception and uses the returned value as a response from this method.
- *
+ * @param parameters
+ * Request parameters of the pushed authorization request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the pushed authorization request.
+ *
+ * @param clientCertificates
+ * The certificate path used in mutual TLS authentication, in PEM format. The
+ * client's own certificate is the first in this array. Can be {@code null}.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ */
+ protected Response handle(
+ AuthleteApi api, MultivaluedMap parameters,
+ String authorization, String[] clientCertificates)
+ {
+ return handle(api, parameters, authorization, clientCertificates, null);
+ }
+
+
+ /**
+ * Handle a pushed authorization request. This method is an alias of the {@link
+ * #handle(AuthleteApi, Params, Options)} method.
*
* @param api
* An implementation of {@link AuthleteApi}.
@@ -68,12 +83,17 @@ public class BasePushedAuthReqEndpoint extends BaseEndpoint
* The certificate path used in mutual TLS authentication, in PEM format. The
* client's own certificate is the first in this array. Can be {@code null}.
*
+ * @param options
+ * Request options for the {@code /api/pushed_auth_req} API.
+ *
* @return
* A response that should be returned to the client application.
+ *
+ * @since 2.82
*/
protected Response handle(
AuthleteApi api, MultivaluedMap parameters,
- String authorization, String[] clientCertificates)
+ String authorization, String[] clientCertificates, Options options)
{
Params params = new Params()
.setParameters(parameters)
@@ -81,7 +101,28 @@ protected Response handle(
.setClientCertificatePath(clientCertificates)
;
- return handle(api, params);
+ return handle(api, params, options);
+ }
+
+
+ /**
+ * Handle a PAR request. This method is an alias of the {@link
+ * #handle(AuthleteApi, Params, Options) handle}{@code (api, params, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param params
+ * Parameters needed to handle the PAR request.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ *
+ * @since 2.70
+ */
+ public Response handle(AuthleteApi api, Params params)
+ {
+ return handle(api, params, null);
}
@@ -90,15 +131,15 @@ protected Response handle(
*
*
* This method internally creates a {@link PushedAuthReqHandler} instance and
- * calls its {@link PushedAuthReqHandler#handle(PushedAuthReqHandler.Params)
- * handle(Params)} method. Then, this method uses the value returned from
- * the {@code handle()} method as a response from this method.
+ * calls its {@link PushedAuthReqHandler#handle(PushedAuthReqHandler.Params, Options)}
+ * method. Then, this method uses the value returned from the {@code handle()}
+ * method as a response from this method.
*
*
*
* When {@code PushedAuthReqHandler.handle()} method raises a {@link
- * WebApplicationException}, this method calls {@link #onError(WebApplicationException)
- * onError()} method with the exception. The default implementation of {@code onError()}
+ * WebApplicationException}, this method calls {@link #onError(WebApplicationException) onError()}
+ * method with the exception. The default implementation of {@code onError()}
* does nothing. You can override the method as necessary. After calling
* {@code onError()} method, this method calls {@code getResponse()} method of
* the exception and uses the returned value as a response from this method.
@@ -110,12 +151,15 @@ protected Response handle(
* @param params
* Parameters needed to handle the PAR request.
*
+ * @param options
+ * Request options for the {@code /api/pushed_auth_req} API.
+ *
* @return
* A response that should be returned to the client application.
*
- * @since 2.70
+ * @since 2.82
*/
- public Response handle(AuthleteApi api, Params params)
+ public Response handle(AuthleteApi api, Params params, Options options)
{
try
{
@@ -123,7 +167,7 @@ public Response handle(AuthleteApi api, Params params)
PushedAuthReqHandler handler = new PushedAuthReqHandler(api);
// Delegate the task to the handler.
- return handler.handle(params);
+ return handler.handle(params, options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseResourceEndpoint.java b/src/main/java/com/authlete/jakarta/BaseResourceEndpoint.java
index 6c6ad5c..8ce143b 100644
--- a/src/main/java/com/authlete/jakarta/BaseResourceEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseResourceEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2023 Authlete, Inc.
+ * Copyright (C) 2016-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -19,6 +19,7 @@
import jakarta.ws.rs.WebApplicationException;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.IntrospectionRequest;
import com.authlete.common.dto.IntrospectionResponse;
import com.authlete.common.web.BearerToken;
@@ -87,7 +88,8 @@ public String extractAccessToken(String authorization, String accessTokenInReque
/**
* Validate an access token. This method is an alias of {@link
- * #validateAccessToken(AuthleteApi, AccessTokenValidator.Params)}.
+ * #validateAccessToken(AuthleteApi, String, Options) validateAccessToken}{@code
+ * (api, accessToken, (Options)null)}.
*
* @param api
* Implementation of {@link AuthleteApi} interface.
@@ -105,17 +107,44 @@ public String extractAccessToken(String authorization, String accessTokenInReque
public AccessTokenInfo validateAccessToken(
AuthleteApi api, String accessToken) throws WebApplicationException
{
- Params params = new Params()
- .setAccessToken(accessToken)
- ;
+ return validateAccessToken(api, accessToken, (Options)null);
+ }
+
- return validateAccessToken(api, params);
+ /**
+ * Validate an access token. This method is an alias of {@link
+ * #validateAccessToken(AuthleteApi, String, String[], Options) validateAccessToken}{@code
+ * (api, accessToken, null, options)}.
+ *
+ * @param api
+ * Implementation of {@link AuthleteApi} interface.
+ *
+ * @param accessToken
+ * An access token to validate.
+ *
+ * @param options
+ * Request options for {@code /api/auth/introspection} API.
+ *
+ * @return
+ * Information about the access token.
+ *
+ * @throws WebApplicationException
+ * The access token is invalid. To be concrete, the access
+ * token does not exist or it has expired.
+ *
+ * @since 2.82
+ */
+ public AccessTokenInfo validateAccessToken(
+ AuthleteApi api, String accessToken, Options options) throws WebApplicationException
+ {
+ return validateAccessToken(api, accessToken, null, options);
}
/**
* Validate an access token. This method is an alias of {@link
- * #validateAccessToken(AuthleteApi, AccessTokenValidator.Params)}.
+ * #validateAccessToken(AuthleteApi, String, String[], Options) validateAccessToken}{@code
+ * (api, accessToken, requiredScopes, (Options)null)}.
*
* @param api
* Implementation of {@link AuthleteApi} interface.
@@ -142,18 +171,54 @@ public AccessTokenInfo validateAccessToken(
public AccessTokenInfo validateAccessToken(
AuthleteApi api, String accessToken, String[] requiredScopes) throws WebApplicationException
{
- Params params = new Params()
- .setAccessToken(accessToken)
- .setRequiredScopes(requiredScopes)
- ;
+ return validateAccessToken(api, accessToken, requiredScopes, (Options)null);
+ }
+
- return validateAccessToken(api, params);
+ /**
+ * Validate an access token. This method is an alias of {@link
+ * #validateAccessToken(AuthleteApi, String, String[], String, Options)
+ * validateAccessToken}{@code (api, accessToken, requiredScopes, null, options)}.
+ *
+ * @param api
+ * Implementation of {@link AuthleteApi} interface.
+ *
+ * @param accessToken
+ * An access token to validate.
+ *
+ * @param requiredScopes
+ * Scopes that must be associated with the access token.
+ * {@code null} is okay.
+ *
+ * @param options
+ * Request options for {@code /api/auth/introspection} API.
+ *
+ * @return
+ * Information about the access token.
+ *
+ * @throws WebApplicationException
+ * The access token is invalid. To be concrete, one or more of
+ * the following conditions meet.
+ *
+ * - The access token does not exist.
+ *
- The access token has expired.
+ *
- The access token does not cover the required scopes.
+ *
+ *
+ * @since 2.82
+ */
+ public AccessTokenInfo validateAccessToken(
+ AuthleteApi api, String accessToken, String[] requiredScopes, Options options)
+ throws WebApplicationException
+ {
+ return validateAccessToken(api, accessToken, requiredScopes, null, options);
}
/**
* Validate an access token. This method is an alias of {@link
- * #validateAccessToken(AuthleteApi, AccessTokenValidator.Params)}.
+ * #validateAccessToken(AuthleteApi, String, String[], String, Options)}{@code
+ * (api, accessToken, requiredScopes, requiredSubject, (Options)null)}.
*
* @param api
* Implementation of {@link AuthleteApi} interface.
@@ -185,19 +250,60 @@ public AccessTokenInfo validateAccessToken(
AuthleteApi api, String accessToken,
String[] requiredScopes, String requiredSubject) throws WebApplicationException
{
- Params params = new Params()
- .setAccessToken(accessToken)
- .setRequiredScopes(requiredScopes)
- .setRequiredSubject(requiredSubject)
- ;
+ return validateAccessToken(
+ api, accessToken, requiredScopes, requiredSubject, (Options)null);
+ }
+
- return validateAccessToken(api, params);
+ /**
+ * Validate an access token. This method is an alias of {@link
+ * #validateAccessToken(AuthleteApi, String, String[], String, String, Options)
+ * validateAccessToken}{@code (api, accessToken, requiredScopes, requiredSubject, null, null)}.
+ *
+ * @param api
+ * Implementation of {@link AuthleteApi} interface.
+ *
+ * @param accessToken
+ * An access token to validate.
+ *
+ * @param requiredScopes
+ * Scopes that must be associated with the access token.
+ * {@code null} is okay.
+ *
+ * @param requiredSubject
+ * Subject (= user's unique identifier) that must be associated
+ * with the access token. {@code null} is okay.
+ *
+ * @param options
+ * Request options for {@code /api/auth/introspection} API.
+ *
+ * @return
+ * Information about the access token.
+ *
+ * @throws WebApplicationException
+ * The access token is invalid. To be concrete, one or more of
+ * the following conditions meet.
+ *
+ * - The access token does not exist.
+ *
- The access token has expired.
+ *
- The access token does not cover the required scopes.
+ *
+ *
+ * @since 2.82
+ */
+ public AccessTokenInfo validateAccessToken(
+ AuthleteApi api, String accessToken,
+ String[] requiredScopes, String requiredSubject, Options options) throws WebApplicationException
+ {
+ return validateAccessToken(
+ api, accessToken, requiredScopes, requiredSubject, null, null);
}
/**
* Validate an access token. This method is an alias of {@link
- * #validateAccessToken(AuthleteApi, AccessTokenValidator.Params)}.
+ * #validateAccessToken(AuthleteApi, String, String[], String, String, Options)
+ * validateAccessToken}{@code (api, accessToken, requiredScopes, requiredSubject, clientCertificate, null)}.
*
* @param api
* Implementation of {@link AuthleteApi} interface.
@@ -238,6 +344,59 @@ public AccessTokenInfo validateAccessToken(
public AccessTokenInfo validateAccessToken(
AuthleteApi api, String accessToken, String[] requiredScopes,
String requiredSubject, String clientCertificate) throws WebApplicationException
+ {
+ return validateAccessToken(
+ api, accessToken, requiredScopes, requiredSubject, clientCertificate, null);
+ }
+
+
+ /**
+ * Validate an access token. This method is an alias of {@link
+ * #validateAccessToken(AuthleteApi, AccessTokenValidator.Params, Options)}
+ * method.
+ *
+ * @param api
+ * Implementation of {@link AuthleteApi} interface.
+ *
+ * @param accessToken
+ * An access token to validate.
+ *
+ * @param requiredScopes
+ * Scopes that must be associated with the access token.
+ * {@code null} is okay.
+ *
+ * @param requiredSubject
+ * Subject (= user's unique identifier) that must be associated
+ * with the access token. {@code null} is okay.
+ *
+ * @param clientCertificate
+ * TLS Certificate of the client presented during a call to
+ * the resource server, used with TLS-bound access tokens.
+ * Can be {@code null} if no certificate is presented.
+ *
+ * @param options
+ * Request options for {@code /api/auth/introspection} API.
+ *
+ * @return
+ * Information about the access token.
+ *
+ * @throws WebApplicationException
+ * The access token is invalid. To be concrete, one or more of
+ * the following conditions meet.
+ *
+ * - The access token does not exist.
+ *
- The access token has expired.
+ *
- The access token does not cover the required scopes.
+ *
- The access token is not associated with the required subject.
+ *
- The access token is bound to a client certificate, but the
+ * given one does not match.
+ *
+ *
+ * @since 2.82
+ */
+ public AccessTokenInfo validateAccessToken(
+ AuthleteApi api, String accessToken, String[] requiredScopes,
+ String requiredSubject, String clientCertificate, Options options) throws WebApplicationException
{
Params params = new Params()
.setAccessToken(accessToken)
@@ -246,7 +405,34 @@ public AccessTokenInfo validateAccessToken(
.setClientCertificate(clientCertificate)
;
- return validateAccessToken(api, params);
+ return validateAccessToken(api, params, options);
+ }
+
+
+ /**
+ * Validate an access token. This method is an alias of {@link
+ * #validateAccessToken(AuthleteApi, AccessTokenValidator.Params, Options)
+ * validateAccessToken}{@code (api, params, null)}.
+ * .
+ *
+ * @param api
+ * Implementation of {@link AuthleteApi} interface.
+ *
+ * @param params
+ * Parameters needed for access token validation.
+ *
+ * @return
+ * Information about the access token.
+ *
+ * @throws WebApplicationException
+ * The Access Token is invalid.
+ *
+ * @since 2.27
+ */
+ public AccessTokenInfo validateAccessToken(
+ AuthleteApi api, Params params) throws WebApplicationException
+ {
+ return validateAccessToken(api, params, null);
}
@@ -278,21 +464,24 @@ public AccessTokenInfo validateAccessToken(
* @param params
* Parameters needed for access token validation.
*
+ * @param options
+ * Request options for {@code /api/auth/introspection} API.
+ *
* @return
* Information about the access token.
*
* @throws WebApplicationException
* The Access Token is invalid.
*
- * @since 2.27
+ * @since 2.82
*/
public AccessTokenInfo validateAccessToken(
- AuthleteApi api, Params params) throws WebApplicationException
+ AuthleteApi api, Params params, Options options) throws WebApplicationException
{
try
{
// Validate the access token and obtain the information about it.
- return new AccessTokenValidator(api).validate(params);
+ return new AccessTokenValidator(api).validate(params, options);
}
catch (WebApplicationException e)
{
@@ -306,11 +495,18 @@ public AccessTokenInfo validateAccessToken(
public IntrospectionResponse validateAccessToken(
AuthleteApi api, IntrospectionRequest request) throws WebApplicationException
+ {
+ return validateAccessToken(api, request, null);
+ }
+
+
+ public IntrospectionResponse validateAccessToken(
+ AuthleteApi api, IntrospectionRequest request, Options options) throws WebApplicationException
{
try
{
// Validate the access token and obtain the information about it.
- return new AccessTokenValidator(api).validate(request);
+ return new AccessTokenValidator(api).validate(request, options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseRevocationEndpoint.java b/src/main/java/com/authlete/jakarta/BaseRevocationEndpoint.java
index 99387da..45e190b 100644
--- a/src/main/java/com/authlete/jakarta/BaseRevocationEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseRevocationEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2020 Authlete, Inc.
+ * Copyright (C) 2016-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
/**
@@ -37,21 +38,45 @@
*/
public class BaseRevocationEndpoint extends BaseEndpoint
{
+ /**
+ * Handle a revocation request. This method is an alias of {@link
+ * #handle(AuthleteApi, MultivaluedMap, String, Options) handle}{@code
+ * (api, parameters, authorization, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param parameters
+ * Request parameters of a revocation request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ */
+ public Response handle(
+ AuthleteApi api, MultivaluedMap parameters, String authorization)
+ {
+ return handle(api, parameters, authorization, null);
+ }
+
+
/**
* Handle a revocation request.
*
*
* This method internally creates a {@link RevocationRequestHandler} instance
- * and calls its {@link RevocationRequestHandler#handle(MultivaluedMap, String)
- * handle()} method with the {@code parameters} argument and the {@code authorization}
+ * and calls its {@link RevocationRequestHandler#handle(MultivaluedMap, String, Options)}
+ * method with the {@code parameters} argument and the {@code authorization}
* argument. Then, this method uses the value returned from the {@code handle()}
* method as a response from this method.
*
*
*
* When {@code RevocationRequestHandler.handle()} method raises a {@link
- * WebApplicationException}, this method calls {@link #onError(WebApplicationException)
- * onError()} method with the exception. The default implementation of {@code onError()}
+ * WebApplicationException}, this method calls {@link #onError(WebApplicationException) onError()}
+ * method with the exception. The default implementation of {@code onError()}
* does nothing. You
* can override the method as necessary. After calling {@code onError()} method,
* this method calls {@code getResponse()} method of the exception and uses the
@@ -67,10 +92,17 @@ public class BaseRevocationEndpoint extends BaseEndpoint
* @param authorization
* The value of {@code Authorization} header.
*
+ * @param options
+ * Request options for {@code /api/auth/revocation} API.
+ *
* @return
* A response that should be returned to the client application.
+ *
+ * @since 2.82
*/
- public Response handle(AuthleteApi api, MultivaluedMap parameters, String authorization)
+ public Response handle(
+ AuthleteApi api, MultivaluedMap parameters, String authorization,
+ Options options)
{
try
{
@@ -78,7 +110,7 @@ public Response handle(AuthleteApi api, MultivaluedMap parameter
RevocationRequestHandler handler = new RevocationRequestHandler(api);
// Delegate the task to the handler.
- return handler.handle(parameters, authorization);
+ return handler.handle(parameters, authorization, options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseTokenEndpoint.java b/src/main/java/com/authlete/jakarta/BaseTokenEndpoint.java
index 980813d..93ef025 100644
--- a/src/main/java/com/authlete/jakarta/BaseTokenEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseTokenEndpoint.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2022 Authlete, Inc.
+ * Copyright (C) 2016-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.jakarta.TokenRequestHandler.Params;
import com.authlete.jakarta.spi.TokenRequestHandlerSpi;
@@ -41,10 +42,9 @@
public class BaseTokenEndpoint extends BaseEndpoint
{
/**
- * Handle a token request.
- *
- * This method is an alias of the {@link #handle(AuthleteApi,
- * TokenRequestHandlerSpi, TokenRequestHandler.Params)} method.
+ * Handle a token request. This method is an alias of {@link #handle(AuthleteApi,
+ * TokenRequestHandlerSpi, MultivaluedMap, String, Options, Options, Options)
+ * handle}{@code (api, spi, parameters, authorization, null, null, null)}.
*
* @param api
* An implementation of {@link AuthleteApi}.
@@ -65,20 +65,55 @@ public Response handle(
AuthleteApi api, TokenRequestHandlerSpi spi,
MultivaluedMap parameters, String authorization)
{
- Params params = new Params()
- .setParameters(parameters)
- .setAuthorization(authorization)
- ;
-
- return handle(api, spi, params);
+ return handle(api, spi, parameters, authorization, null, null, null);
}
/**
- * Handle a token request.
+ * Handle a token request. This method is an alias of the {@link #handle(AuthleteApi,
+ * TokenRequestHandlerSpi, MultivaluedMap, String, String[], Options) handle}{@code
+ * (api, spi, parameters, authorization, null, tokenOpts, tokenIssueOpts, tokenFailOpts)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param spi
+ * An implementation of {@link TokenRequestHandlerSpi}.
+ *
+ * @param parameters
+ * Request parameters of the token request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the token request.
+ *
+ * @param tokenOpts
+ * Request options for the {@code /api/auth/token} API.
*
- * This method is an alias of the {@link #handle(AuthleteApi,
- * TokenRequestHandlerSpi, TokenRequestHandler.Params)} method.
+ * @param tokenIssueOpts
+ * Request options for the {@code /api/auth/token/issue} API.
+ *
+ * @param tokenFailOpts
+ * Request options for the {@code /api/auth/token/fail} API.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ AuthleteApi api, TokenRequestHandlerSpi spi,
+ MultivaluedMap parameters, String authorization,
+ Options tokenOpts, Options tokenIssueOpts, Options tokenFailOpts)
+ {
+ return handle(
+ api, spi, parameters, authorization, null, tokenOpts, tokenIssueOpts, tokenFailOpts);
+ }
+
+
+ /**
+ * Handle a token request. This method is an alias of the {@link #handle(AuthleteApi,
+ * TokenRequestHandlerSpi, MultivaluedMap, String, String[], Options, Options, Options)
+ * handle}{@code (api, spi, parameters, authorization, clientCertificatePath, null, null, null)}.
*
* @param api
* An implementation of {@link AuthleteApi}.
@@ -105,6 +140,53 @@ public Response handle(
public Response handle(
AuthleteApi api, TokenRequestHandlerSpi spi,
MultivaluedMap parameters, String authorization, String[] clientCertificatePath)
+ {
+ return handle(
+ api, spi, parameters, authorization, clientCertificatePath, null, null, null);
+ }
+
+
+ /**
+ * Handle a token request. This method is an alias of the {@link #handle(AuthleteApi,
+ * TokenRequestHandlerSpi, TokenRequestHandler.Params, Options, Options, Options)}
+ * method.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param spi
+ * An implementation of {@link TokenRequestHandlerSpi}.
+ *
+ * @param parameters
+ * Request parameters of the token request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the token request.
+ *
+ * @param clientCertificatePath
+ * The certificate path used in mutual TLS authentication, each in
+ * PEM format. The client's own certificate is the first in this
+ * array. Can be {@code null}.
+ *
+ * @param tokenOpts
+ * Request options for the {@code /api/auth/token} API.
+ *
+ * @param tokenIssueOpts
+ * Request options for the {@code /api/auth/token/issue} API.
+ *
+ * @param tokenFailOpts
+ * Request options for the {@code /api/auth/token/fail} API.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ AuthleteApi api, TokenRequestHandlerSpi spi,
+ MultivaluedMap parameters, String authorization,
+ String[] clientCertificatePath, Options tokenOpts, Options tokenIssueOpts,
+ Options tokenFailOpts)
{
Params params = new Params()
.setParameters(parameters)
@@ -112,7 +194,33 @@ public Response handle(
.setClientCertificatePath(clientCertificatePath)
;
- return handle(api, spi, params);
+ return handle(api, spi, params, tokenOpts, tokenIssueOpts, tokenFailOpts);
+ }
+
+
+ /**
+ * Handle a token request. This method is an alias of {@link #handle(AuthleteApi,
+ * TokenRequestHandlerSpi, TokenRequestHandler.Params, Options, Options, Options)
+ * handle}{@code (api, spi, params, null, null, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param spi
+ * An implementation of {@link TokenRequestHandlerSpi}.
+ *
+ * @param params
+ * Parameters needed to handle the token request.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ *
+ * @since 2.27
+ */
+ public Response handle(
+ AuthleteApi api, TokenRequestHandlerSpi spi, Params params)
+ {
+ return handle(api, spi, params, null, null, null);
}
@@ -121,15 +229,15 @@ public Response handle(
*
*
* This method internally creates a {@link TokenRequestHandler} instance and
- * calls its {@link TokenRequestHandler#handle(TokenRequestHandler.Params)
- * handle(Params)} method. Then, this method uses the value returned from
- * the {@code handle()} method as a response from this method.
+ * calls its {@link TokenRequestHandler#handle(TokenRequestHandler.Params, Options)}
+ * method. Then, this method uses the value returned from the {@code handle()}
+ * method as a response from this method.
*
*
*
* When {@code TokenRequestHandler.handle()} method raises a {@link
- * WebApplicationException}, this method calls {@link #onError(WebApplicationException)
- * onError()} method with the exception. The default implementation of {@code onError()}
+ * WebApplicationException}, this method calls {@link #onError(WebApplicationException) onError()}
+ * method with the exception. The default implementation of {@code onError()}
* does nothing. You can override the method as necessary. After calling
* {@code onError()} method, this method calls {@code getResponse()} method of
* the exception and uses the returned value as a response from this method.
@@ -144,13 +252,23 @@ public Response handle(
* @param params
* Parameters needed to handle the token request.
*
+ * @param tokenOpts
+ * Request options for the {@code /api/auth/token} API.
+ *
+ * @param tokenIssueOpts
+ * Request options for the {@code /api/auth/token/issue} API.
+ *
+ * @param tokenFailOpts
+ * Request options for the {@code /api/auth/token/fail} API.
+ *
* @return
* A response that should be returned to the client application.
*
- * @since 2.27
+ * @since 2.82
*/
public Response handle(
- AuthleteApi api, TokenRequestHandlerSpi spi, Params params)
+ AuthleteApi api, TokenRequestHandlerSpi spi, Params params, Options tokenOpts,
+ Options tokenIssueOpts, Options tokenFailOpts)
{
try
{
@@ -158,7 +276,7 @@ public Response handle(
TokenRequestHandler handler = new TokenRequestHandler(api, spi);
// Delegate the task to the handler.
- return handler.handle(params);
+ return handler.handle(params, tokenOpts, tokenIssueOpts, tokenFailOpts);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/BaseUserInfoEndpoint.java b/src/main/java/com/authlete/jakarta/BaseUserInfoEndpoint.java
index c60e031..3275c63 100644
--- a/src/main/java/com/authlete/jakarta/BaseUserInfoEndpoint.java
+++ b/src/main/java/com/authlete/jakarta/BaseUserInfoEndpoint.java
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.jakarta.UserInfoRequestHandler.Params;
import com.authlete.jakarta.spi.UserInfoRequestHandlerSpi;
@@ -36,11 +37,35 @@
*/
public class BaseUserInfoEndpoint extends BaseResourceEndpoint
{
+ /**
+ * Handle a userinfo request. This method is an alias of {@link
+ * #handle(AuthleteApi, UserInfoRequestHandlerSpi, UserInfoRequestHandler.Params)
+ * handle}{@code (api, spi, accessToken, null, null)}.
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param spi
+ * An implementation of {@link UserInfoRequestHandlerSpi}.
+ *
+ * @param accessToken
+ * An access token.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ */
+ public Response handle(
+ AuthleteApi api, UserInfoRequestHandlerSpi spi, String accessToken)
+ {
+ return handle(api, spi, accessToken, null, null);
+ }
+
+
/**
* Handle a userinfo request.
*
- * This method is an alias of the {@link #handle(AuthleteApi,
- * UserInfoRequestHandlerSpi, UserInfoRequestHandler.Params)} method.
+ * This method is an alias of the {@link #handle(AuthleteApi, UserInfoRequestHandlerSpi,
+ * UserInfoRequestHandler.Params)} method.
*
* @param api
* An implementation of {@link AuthleteApi}.
@@ -51,17 +76,26 @@ public class BaseUserInfoEndpoint extends BaseResourceEndpoint
* @param accessToken
* An access token.
*
+ * @param userInfoOpts
+ * Request options for the {@code /api/auth/userinfo} API.
+ *
+ * @param userInfoIssueOpts
+ * Request options for the {@code /api/auth/userinfo/issue} API.
+ *
* @return
* A response that should be returned to the client application.
+ *
+ * @since 2.82
*/
public Response handle(
- AuthleteApi api, UserInfoRequestHandlerSpi spi, String accessToken)
+ AuthleteApi api, UserInfoRequestHandlerSpi spi, String accessToken,
+ Options userInfoOpts, Options userInfoIssueOpts)
{
Params params = new Params()
.setAccessToken(accessToken)
;
- return handle(api, spi, params);
+ return handle(api, spi, params, userInfoOpts, userInfoIssueOpts);
}
@@ -102,6 +136,55 @@ public Response handle(
*/
public Response handle(
AuthleteApi api, UserInfoRequestHandlerSpi spi, Params params)
+ {
+ return handle(api, spi, params, null, null);
+ }
+
+
+ /**
+ * Handle a userinfo request.
+ *
+ *
+ * This method internally creates a {@link UserInfoRequestHandler} instance
+ * and calls its
+ * {@link UserInfoRequestHandler#handle(UserInfoRequestHandler.Params)
+ * handle(Params)} method. Then, this method uses the value returned from
+ * the {@code handle()} method as a response from this method.
+ *
+ *
+ *
+ * When {@code UserInfoRequestHandler.handle()} method raises a {@link
+ * WebApplicationException}, this method calls {@link
+ * #onError(WebApplicationException) onError()} method with the exception.
+ * The default implementation of {@code onError()} does nothing. You can
+ * override the method as necessary. After calling {@code onError()}
+ * method, this method calls {@code getResponse()} method of the exception
+ * and uses the returned value as a response from this method.
+ *
+ *
+ * @param api
+ * An implementation of {@link AuthleteApi}.
+ *
+ * @param spi
+ * An implementation of {@link UserInfoRequestHandlerSpi}.
+ *
+ * @param params
+ * Parameters needed to handle the userinfo request.
+ *
+ * @param userInfoOpts
+ * Request options for the {@code /api/auth/userinfo} API.
+ *
+ * @param userInfoIssueOpts
+ * Request options for the {@code /api/auth/userinfo/issue} API.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ AuthleteApi api, UserInfoRequestHandlerSpi spi, Params params, Options userInfoOpts,
+ Options userInfoIssueOpts)
{
try
{
@@ -109,7 +192,7 @@ public Response handle(
UserInfoRequestHandler handler = new UserInfoRequestHandler(api, spi);
// Delegate the task to the handler.
- return handler.handle(params);
+ return handler.handle(params, userInfoOpts, userInfoIssueOpts);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/ClientRegistrationRequestHandler.java b/src/main/java/com/authlete/jakarta/ClientRegistrationRequestHandler.java
index 6f514dc..8b3fbfc 100644
--- a/src/main/java/com/authlete/jakarta/ClientRegistrationRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/ClientRegistrationRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019-2021 Authlete, Inc.
+ * Copyright (C) 2019-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.ClientRegistrationResponse;
import com.authlete.common.dto.ClientRegistrationResponse.Action;
import com.authlete.common.web.BearerToken;
@@ -89,7 +90,8 @@ public ClientRegistrationRequestHandler(AuthleteApi api)
/**
- * Handle a dynamic client registration request.
+ * Handle a dynamic client registration request. This method is an alias of
+ * {@link #handleRegister(String, String, Options)}{@code (json, authorization, null)}.
*
* @param json
* The serialized JSON body of the client registration request.
@@ -105,13 +107,40 @@ public ClientRegistrationRequestHandler(AuthleteApi api)
* An error occurred.
*/
public Response handleRegister(String json, String authorization)
+ {
+ return handleRegister(json, authorization, null);
+ }
+
+
+ /**
+ * Handle a dynamic client registration request.
+ *
+ * @param json
+ * The serialized JSON body of the client registration request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the token request.
+ * This is optional.
+ *
+ * @param options
+ * Request options for the {@code /api/client/registration} API.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handleRegister(String json, String authorization, Options options)
{
String initialAccessToken = BearerToken.parse(authorization);
try
{
ClientRegistrationResponse response = getApiCaller().callClientRegistration(
- json, initialAccessToken);
+ json, initialAccessToken, options);
return process(response);
}
catch (WebApplicationException e)
@@ -126,7 +155,8 @@ public Response handleRegister(String json, String authorization)
/**
- * Handle a dynamic client management GET request.
+ * Handle a dynamic client management GET request. This method is an alias of
+ * the {@link #handleGet(String, String, Options)}{@code (clientId, authorization, null)}.
*
* @param clientId
* The client ID as determined by the incoming request.
@@ -142,13 +172,40 @@ public Response handleRegister(String json, String authorization)
* An error occurred.
*/
public Response handleGet(String clientId, String authorization)
+ {
+ return handleGet(clientId, authorization, null);
+ }
+
+
+ /**
+ * Handle a dynamic client management GET request.
+ *
+ * @param clientId
+ * The client ID as determined by the incoming request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the registration request.
+ * This is optional.
+ *
+ * @param options
+ * Request options for the {@code /api/client/registration} API.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handleGet(String clientId, String authorization, Options options)
{
String registrationAccessToken = BearerToken.parse(authorization);
try
{
ClientRegistrationResponse response = getApiCaller().callClientRegistrationGet(
- clientId, registrationAccessToken);
+ clientId, registrationAccessToken, options);
return process(response);
}
catch (WebApplicationException e)
@@ -163,7 +220,8 @@ public Response handleGet(String clientId, String authorization)
/**
- * Handle a dynamic client management PUT request.
+ * Handle a dynamic client management PUT request. This method is an alias of
+ * {@link #handleUpdate(String, String, String, Options)}{@code (clientId, json, authorization, null)}.
*
* @param clientId
* The client ID as determined by the incoming request.
@@ -182,13 +240,44 @@ public Response handleGet(String clientId, String authorization)
* An error occurred.
*/
public Response handleUpdate(String clientId, String json, String authorization)
+ {
+ return handleUpdate(clientId, json, authorization, null);
+ }
+
+
+ /**
+ * Handle a dynamic client management PUT request.
+ *
+ * @param clientId
+ * The client ID as determined by the incoming request.
+ *
+ * @param json
+ * The serialized JSON body of the client update request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the registration request.
+ * This is optional.
+ *
+ * @param options
+ * Request options for the {@code /api/client/registration} API.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handleUpdate(
+ String clientId, String json, String authorization, Options options)
{
String registrationAccessToken = BearerToken.parse(authorization);
try
{
ClientRegistrationResponse response = getApiCaller().callClientRegistrationUpdate(
- clientId, json, registrationAccessToken);
+ clientId, json, registrationAccessToken, options);
return process(response);
}
catch (WebApplicationException e)
@@ -203,7 +292,8 @@ public Response handleUpdate(String clientId, String json, String authorization)
/**
- * Handle a dynamic client management DELETE request.
+ * Handle a dynamic client management DELETE request. This method is an alias
+ * of {@link #handleDelete(String, String, Options)}{@code (clientId, authorization, null)}.
*
* @param clientId
* The client ID as determined by the incoming request.
@@ -219,13 +309,40 @@ public Response handleUpdate(String clientId, String json, String authorization)
* An error occurred.
*/
public Response handleDelete(String clientId, String authorization)
+ {
+ return handleDelete(clientId, authorization, null);
+ }
+
+
+ /**
+ * Handle a dynamic client management DELETE request.
+ *
+ * @param clientId
+ * The client ID as determined by the incoming request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header of the registration request.
+ * This is optional.
+ *
+ * @param options
+ * Request options for the {@code /api/client/registration} API.
+ *
+ * @return
+ * A response that should be returned to the client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handleDelete(String clientId, String authorization, Options options)
{
String registrationAccessToken = BearerToken.parse(authorization);
try
{
ClientRegistrationResponse response = getApiCaller().callClientRegistrationDelete(
- clientId, registrationAccessToken);
+ clientId, registrationAccessToken, options);
return process(response);
}
catch (WebApplicationException e)
diff --git a/src/main/java/com/authlete/jakarta/ConfigurationRequestHandler.java b/src/main/java/com/authlete/jakarta/ConfigurationRequestHandler.java
index 7fd916d..1e0ae95 100644
--- a/src/main/java/com/authlete/jakarta/ConfigurationRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/ConfigurationRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2022 Authlete, Inc.
+ * Copyright (C) 2016-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.ServiceConfigurationRequest;
@@ -102,6 +103,48 @@ public Response handle() throws WebApplicationException
}
+ /**
+ * Handle a request to an OpenID Provider configuration endpoint. This
+ * method is an alias of {@link #handle(boolean, Options) handle}{@code (true, options)}.
+ *
+ * @param options
+ * Request options to the Authlete API.
+ *
+ * @return
+ * A response that should be returned from the endpoint to
+ * the client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(Options options) throws WebApplicationException
+ {
+ return handle(true, options);
+ }
+
+
+ /**
+ * Handle a request to an OpenID Provider configuration endpoint. This
+ * method is an alias of {@link #handle(boolean, Options) handle}{@code (pretty, null)}.
+ *
+ * @param pretty
+ * {@code true} to return the output JSON in pretty format.
+ *
+ * @return
+ * A response that should be returned from the endpoint to
+ * the client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ */
+ public Response handle(boolean pretty) throws WebApplicationException
+ {
+ return handle(pretty, null);
+ }
+
+
/**
* Handle a request to an OpenID Provider configuration endpoint. This
* method internally calls Authlete's {@code /api/service/configuration}
@@ -110,21 +153,26 @@ public Response handle() throws WebApplicationException
* @param pretty
* {@code true} to return the output JSON in pretty format.
*
+ * @param options
+ * Request options to the Authlete API.
+ *
* @return
* A response that should be returned from the endpoint to
* the client application.
*
* @throws WebApplicationException
* An error occurred.
+ *
+ * @since 2.82
*/
- public Response handle(boolean pretty) throws WebApplicationException
+ public Response handle(boolean pretty, Options options) throws WebApplicationException
{
try
{
// Call Authlete's /api/service/configuration API.
// The API returns a JSON that complies with
// OpenID Connect Discovery 1.0.
- String json = getApiCaller().callServiceConfiguration(pretty);
+ String json = getApiCaller().callServiceConfiguration(pretty, options);
// Response as "application/json;charset=UTF-8" with 200 OK.
return ResponseUtil.ok(json);
@@ -144,8 +192,8 @@ public Response handle(boolean pretty) throws WebApplicationException
/**
* Handle a request to an OpenID Provider configuration endpoint. This
- * method internally calls Authlete's {@code /api/service/configuration}
- * API.
+ * method is an alias of {@link
+ * #handle(ServiceConfigurationRequest, Options) handle}{@code (request, null)}.
*
* @param request
* Request parameters to the Authlete API.
@@ -159,13 +207,39 @@ public Response handle(boolean pretty) throws WebApplicationException
* @since 2.50
*/
public Response handle(ServiceConfigurationRequest request) throws WebApplicationException
+ {
+ return handle(request, null);
+ }
+
+
+ /**
+ * Handle a request to an OpenID Provider configuration endpoint. This
+ * method internally calls Authlete's {@code /api/service/configuration}
+ * API.
+ *
+ * @param request
+ * Request parameters to the Authlete API.
+ *
+ * @param options
+ * Request options to the Authlete API.
+ *
+ * @return
+ * A response that should be returned from the discovery endpoint.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ ServiceConfigurationRequest request, Options options) throws WebApplicationException
{
try
{
// Call Authlete's /api/service/configuration API.
// The API returns a JSON that complies with
// OpenID Connect Discovery 1.0.
- String json = getApiCaller().callServiceConfiguration(request);
+ String json = getApiCaller().callServiceConfiguration(request, options);
// Response as "application/json;charset=UTF-8" with 200 OK.
return ResponseUtil.ok(json);
diff --git a/src/main/java/com/authlete/jakarta/CredentialIssuerMetadataRequestHandler.java b/src/main/java/com/authlete/jakarta/CredentialIssuerMetadataRequestHandler.java
index fb17283..355cd5e 100644
--- a/src/main/java/com/authlete/jakarta/CredentialIssuerMetadataRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/CredentialIssuerMetadataRequestHandler.java
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.CredentialIssuerMetadataRequest;
import com.authlete.common.dto.CredentialIssuerMetadataResponse;
import com.authlete.common.dto.CredentialIssuerMetadataResponse.Action;
@@ -53,23 +54,50 @@ public CredentialIssuerMetadataRequestHandler(AuthleteApi api)
}
+ /**
+ * Handle a request to the credential issuer metadata endpoint. This method
+ * is an alias of the {@link
+ * #handle(CredentialIssuerMetadataRequest, Options)}{@code (request, null)}.
+ *
+ * @param request
+ * A credential issuer metadata request.
+ *
+ * @return
+ * A response that should be returned from the credential issuer
+ * metadata endpoint.
+ *
+ * @throws WebApplicationException
+ */
+ public Response handle(
+ CredentialIssuerMetadataRequest request) throws WebApplicationException
+ {
+ return handle(request, null);
+ }
+
+
/**
* Handle a request to the credential issuer metadata endpoint.
*
* @param request
* A credential issuer metadata request.
*
+ * @param options
+ * Request options for the {@code /api/vci/metadata} API.
+ *
* @return
* A response that should be returned from the credential issuer
* metadata endpoint.
*
* @throws WebApplicationException
+ *
+ * @since 2.82
*/
- public Response handle(CredentialIssuerMetadataRequest request) throws WebApplicationException
+ public Response handle(
+ CredentialIssuerMetadataRequest request, Options options) throws WebApplicationException
{
// Call Authlete's /vci/metadata API.
CredentialIssuerMetadataResponse response =
- getApiCaller().callCredentialIssuerMetadata(request);
+ getApiCaller().callCredentialIssuerMetadata(request, options);
// 'action' in the response denotes the next action which
// the implementation of the endpoint should take.
diff --git a/src/main/java/com/authlete/jakarta/CredentialJwtIssuerMetadataRequestHandler.java b/src/main/java/com/authlete/jakarta/CredentialJwtIssuerMetadataRequestHandler.java
index 9eb0462..0f262fc 100644
--- a/src/main/java/com/authlete/jakarta/CredentialJwtIssuerMetadataRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/CredentialJwtIssuerMetadataRequestHandler.java
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.CredentialJwtIssuerMetadataRequest;
import com.authlete.common.dto.CredentialJwtIssuerMetadataResponse;
import com.authlete.common.dto.CredentialJwtIssuerMetadataResponse.Action;
@@ -54,7 +55,9 @@ public CredentialJwtIssuerMetadataRequestHandler(AuthleteApi api)
/**
- * Handle a request to the JWT issuer metadata endpoint.
+ * Handle a request to the JWT issuer metadata endpoint. This method
+ * is an alias of {@link #handle(CredentialJwtIssuerMetadataRequest, Options)
+ * handle}{@code (request, null)}.
*
* @param request
* A JWT issuer metadata request.
@@ -66,10 +69,32 @@ public CredentialJwtIssuerMetadataRequestHandler(AuthleteApi api)
* @throws WebApplicationException
*/
public Response handle(CredentialJwtIssuerMetadataRequest request) throws WebApplicationException
+ {
+ return handle(request, null);
+ }
+
+
+ /**
+ * Handle a request to the JWT issuer metadata endpoint.
+ *
+ * @param request
+ * A JWT issuer metadata request.
+ *
+ * @param options
+ * Request options for the {@code /api/vci/jwtissuer} API.
+ *
+ * @return
+ * A response that should be returned from the JWT issuer
+ * metadata endpoint.
+ *
+ * @throws WebApplicationException
+ */
+ public Response handle(
+ CredentialJwtIssuerMetadataRequest request, Options options) throws WebApplicationException
{
// Call Authlete's /vci/jwtissuer API.
CredentialJwtIssuerMetadataResponse response =
- getApiCaller().callCredentialJwtIssuerMetadata(request);
+ getApiCaller().callCredentialJwtIssuerMetadata(request, options);
// 'action' in the response denotes the next action which
// the implementation of the endpoint should take.
diff --git a/src/main/java/com/authlete/jakarta/CredentialOfferUriRequestHandler.java b/src/main/java/com/authlete/jakarta/CredentialOfferUriRequestHandler.java
index ab1cd6b..d422b5d 100644
--- a/src/main/java/com/authlete/jakarta/CredentialOfferUriRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/CredentialOfferUriRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2023 Authlete, Inc.
+ * Copyright (C) 2023-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.CredentialOfferInfoRequest;
import com.authlete.common.dto.CredentialOfferInfoResponse;
@@ -33,10 +34,17 @@ public CredentialOfferUriRequestHandler(final AuthleteApi api)
public Response handle(final CredentialOfferInfoRequest request)
+ {
+ return handle(request, null);
+ }
+
+
+ public Response handle(final CredentialOfferInfoRequest request, Options options)
{
try
{
- final CredentialOfferInfoResponse response = getApiCaller().callCredentialOfferInfo(request);
+ final CredentialOfferInfoResponse response =
+ getApiCaller().callCredentialOfferInfo(request, options);
return process(response);
}
catch (WebApplicationException e)
diff --git a/src/main/java/com/authlete/jakarta/DeviceAuthorizationRequestHandler.java b/src/main/java/com/authlete/jakarta/DeviceAuthorizationRequestHandler.java
index 985c6fb..69cd016 100644
--- a/src/main/java/com/authlete/jakarta/DeviceAuthorizationRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/DeviceAuthorizationRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019 Authlete, Inc.
+ * Copyright (C) 2019-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,6 +22,7 @@
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.DeviceAuthorizationResponse;
import com.authlete.common.dto.DeviceAuthorizationResponse.Action;
import com.authlete.common.web.BasicCredentials;
@@ -66,7 +67,8 @@ public DeviceAuthorizationRequestHandler(AuthleteApi api)
/**
* Handler for device authorization requests in OAuth 2.0 Device Authorization
- * Grant (Device Flow).
+ * Grant (Device Flow). This method is an alias of {@link #handle(MultivaluedMap, String, String[], Options)
+ * handle}{@code (parameters, authorization, clientCertificatePath, null)}.
*
* @param parameters
* Request parameters of a device authorization request.
@@ -93,6 +95,45 @@ public DeviceAuthorizationRequestHandler(AuthleteApi api)
public Response handle(
MultivaluedMap parameters, String authorization,
String[] clientCertificatePath) throws WebApplicationException
+ {
+ return handle(parameters, authorization, clientCertificatePath, null);
+ }
+
+
+ /**
+ * Handler for device authorization requests in OAuth 2.0 Device Authorization
+ * Grant (Device Flow).
+ *
+ * @param parameters
+ * Request parameters of a device authorization request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header in the device authorization
+ * request. A client application may embed its pair of client ID and
+ * client secret in a device authorization request using Basic
+ * Authentication.
+ *
+ * @param clientCertificatePath
+ * The path of the client's certificate, each in PEM format. The first
+ * item in the array is the client's certificate itself. May be {@code null}
+ * if the client did not send a certificate or path.
+ *
+ * @param options
+ * Request options for the {@code /api/device/authorization} API.
+ *
+ * @return
+ * A response that should be returned from the endpoint to the
+ * client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ MultivaluedMap parameters, String authorization,
+ String[] clientCertificatePath, Options options) throws WebApplicationException
{
// Convert the value of Authorization header (credentials of
// the client application), if any, into BasicCredentials.
@@ -106,7 +147,7 @@ public Response handle(
try
{
// Process the given parameters.
- return process(parameters, clientId, clientSecret, clientCertificatePath);
+ return process(parameters, clientId, clientSecret, clientCertificatePath, options);
}
catch (WebApplicationException e)
{
@@ -125,7 +166,7 @@ public Response handle(
*/
private Response process(
MultivaluedMap parameters, String clientId,
- String clientSecret, String[] clientCertificatePath)
+ String clientSecret, String[] clientCertificatePath, Options options)
{
// TODO: Duplicate code.
String clientCertificate = null;
@@ -144,7 +185,7 @@ private Response process(
// Call Authlete's /api/device/authorization API.
DeviceAuthorizationResponse response = getApiCaller().callDeviceAuthorization(
- parameters, clientId, clientSecret, clientCertificate, clientCertificatePath);
+ parameters, clientId, clientSecret, clientCertificate, clientCertificatePath, options);
// 'action' in the response denotes the next action which
// this service implementation should take.
diff --git a/src/main/java/com/authlete/jakarta/DeviceCompleteRequestHandler.java b/src/main/java/com/authlete/jakarta/DeviceCompleteRequestHandler.java
index e7a9e9f..c21895d 100644
--- a/src/main/java/com/authlete/jakarta/DeviceCompleteRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/DeviceCompleteRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019-2022 Authlete, Inc.
+ * Copyright (C) 2019-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.DeviceCompleteRequest;
import com.authlete.common.dto.DeviceCompleteRequest.Result;
import com.authlete.common.dto.DeviceCompleteResponse;
@@ -76,7 +77,8 @@ public DeviceCompleteRequestHandler(AuthleteApi api, DeviceCompleteRequestHandle
/**
* Handle the result of end-user authentication and authorization in OAuth
- * 2.0 Device Authorization Grant (Device Flow).
+ * 2.0 Device Authorization Grant (Device Flow). This method is an alias of
+ * the {@link #handle(String, String[], Options)} method.
*
* @param userCode
* The user code that the end-user input.
@@ -93,11 +95,41 @@ public DeviceCompleteRequestHandler(AuthleteApi api, DeviceCompleteRequestHandle
* An error occurred.
*/
public Response handle(String userCode, String[] claimNames) throws WebApplicationException
+ {
+ return handle(userCode, claimNames, null);
+ }
+
+
+ /**
+ * Handle the result of end-user authentication and authorization in OAuth
+ * 2.0 Device Authorization Grant (Device Flow).
+ *
+ * @param userCode
+ * The user code that the end-user input.
+ *
+ * @param claimNames
+ * Names of requested claims. Use the value of the {@code claimNames}
+ * parameter in a response from Authlete's {@code /api/device/verification}
+ * API.
+ *
+ * @param options
+ * Request options for the {@code /api/client/registration} API.
+ *
+ * @return
+ * A response that should be returned to the end-user.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ String userCode, String[] claimNames, Options options) throws WebApplicationException
{
try
{
// Process the given parameters.
- return process(userCode, claimNames);
+ return process(userCode, claimNames, options);
}
catch (WebApplicationException e)
{
@@ -111,10 +143,10 @@ public Response handle(String userCode, String[] claimNames) throws WebApplicati
}
- private Response process(String userCode, String[] claimNames)
+ private Response process(String userCode, String[] claimNames, Options options)
{
// Call Authlete's /api/device/complete API.
- DeviceCompleteResponse response = complete(userCode, claimNames);
+ DeviceCompleteResponse response = complete(userCode, claimNames, options);
// 'action' in the response denotes the next action which
// this service implementation should take.
@@ -150,7 +182,7 @@ private Response process(String userCode, String[] claimNames)
}
- private DeviceCompleteResponse complete(String userCode, String[] claimNames)
+ private DeviceCompleteResponse complete(String userCode, String[] claimNames, Options options)
{
// Get the result of end-user authentication and authorization.
Result result = mSpi.getResult();
@@ -165,7 +197,7 @@ private DeviceCompleteResponse complete(String userCode, String[] claimNames)
// The end-user has not successfully authorized the client.
// Then, complete the process with failure.
- return fail(userCode, result, errorDescription, errorUri);
+ return fail(userCode, result, errorDescription, errorUri, options);
}
// OK. The end-user has successfully authorized the client.
@@ -192,7 +224,8 @@ private DeviceCompleteResponse complete(String userCode, String[] claimNames)
Property[] properties = mSpi.getProperties();
// Complete the process with successful authorization.
- return authorize(userCode, subject, authTime, acr, claims, properties, scopes);
+ return authorize(
+ userCode, subject, authTime, acr, claims, properties, scopes, options);
}
@@ -236,30 +269,31 @@ private Map collectClaims(String[] requestedClaimNames)
private DeviceCompleteResponse authorize(
String userCode, String subject, long authTime, String acr, Map claims,
- Property[] properties, String[] scopes)
+ Property[] properties, String[] scopes, Options options)
{
return callDeviceComlete(
userCode, subject, Result.AUTHORIZED, authTime, acr, claims,
- properties, scopes, null, null);
+ properties, scopes, null, null, options);
}
private DeviceCompleteResponse fail(
- String userCode, Result result, String errorDescription, URI errorUri)
+ String userCode, Result result, String errorDescription, URI errorUri,
+ Options options)
{
return callDeviceComlete(
userCode, null, result, 0, null, null, null, null, errorDescription,
- errorUri);
+ errorUri, options);
}
private DeviceCompleteResponse callDeviceComlete(
String userCode, String subject, DeviceCompleteRequest.Result result,
long authTime, String acr, Map claims, Property[] properties,
- String[] scopes, String errorDescription, URI errorUri)
+ String[] scopes, String errorDescription, URI errorUri, Options options)
{
return getApiCaller().callDeviceComplete(
userCode, subject, result, authTime, acr, claims, properties, scopes,
- errorDescription, errorUri);
+ errorDescription, errorUri, options);
}
}
diff --git a/src/main/java/com/authlete/jakarta/DeviceVerificationRequestHandler.java b/src/main/java/com/authlete/jakarta/DeviceVerificationRequestHandler.java
index 0b4b344..066cc77 100644
--- a/src/main/java/com/authlete/jakarta/DeviceVerificationRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/DeviceVerificationRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019-2022 Authlete, Inc.
+ * Copyright (C) 2019-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.DeviceVerificationResponse;
import com.authlete.common.dto.DeviceVerificationResponse.Action;
import com.authlete.jakarta.spi.DeviceVerificationRequestHandlerSpi;
@@ -71,7 +72,8 @@ public DeviceVerificationRequestHandler(AuthleteApi api, DeviceVerificationReque
/**
* Handle information associated with a user code that the end-user
* input at the verification endpoint in OAuth 2.0 Device Authorization Grant
- * (Device Flow).
+ * (Device Flow). This method is an alias of {@link #handle(Options) handle}{@code
+ * (null)}.
*
* @return
* A response that should be returned to the end-user.
@@ -80,11 +82,31 @@ public DeviceVerificationRequestHandler(AuthleteApi api, DeviceVerificationReque
* An error occurred.
*/
public Response handle() throws WebApplicationException
+ {
+ return handle(null);
+ }
+
+
+ /**
+ * Handle information associated with a user code that the end-user
+ * input at the verification endpoint in OAuth 2.0 Device Authorization Grant
+ * (Device Flow).
+ *
+ * @param options
+ * Request options for the {@code /api/device/verification} API.
+ *
+ * @return
+ * A response that should be returned to the end-user.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ */
+ public Response handle(Options options) throws WebApplicationException
{
try
{
// Process the given parameters.
- return process();
+ return process(null);
}
catch (WebApplicationException e)
{
@@ -98,10 +120,11 @@ public Response handle() throws WebApplicationException
}
- private Response process()
+ private Response process(Options options)
{
// Call Authlete's /api/device/verification API.
- DeviceVerificationResponse response = getApiCaller().callDeviceVerification(mSpi.getUserCode());
+ DeviceVerificationResponse response =
+ getApiCaller().callDeviceVerification(mSpi.getUserCode(), options);
// 'action' in the response denotes the next action which
// this service implementation should take.
diff --git a/src/main/java/com/authlete/jakarta/FederationConfigurationRequestHandler.java b/src/main/java/com/authlete/jakarta/FederationConfigurationRequestHandler.java
index 941f576..bd9849b 100644
--- a/src/main/java/com/authlete/jakarta/FederationConfigurationRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/FederationConfigurationRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 Authlete, Inc.
+ * Copyright (C) 2022-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.FederationConfigurationRequest;
import com.authlete.common.dto.FederationConfigurationResponse;
import com.authlete.common.dto.FederationConfigurationResponse.Action;
@@ -54,7 +55,9 @@ public FederationConfigurationRequestHandler(AuthleteApi api)
/**
- * Handle a request to the entity configuration endpoint.
+ * Handle a request to the entity configuration endpoint. This method is an
+ * alias of {@link #handle(FederationConfigurationRequest, Options) handle}{@code
+ * (request, null)}.
*
* @param request
* An entity configuration request.
@@ -66,10 +69,34 @@ public FederationConfigurationRequestHandler(AuthleteApi api)
* @throws WebApplicationException
*/
public Response handle(FederationConfigurationRequest request) throws WebApplicationException
+ {
+ return handle(request, null);
+ }
+
+
+ /**
+ * Handle a request to the entity configuration endpoint.
+ *
+ * @param request
+ * An entity configuration request.
+ *
+ * @param options
+ * Request options for the {@code /api/federation/configuration} API.
+ *
+ * @return
+ * A response that should be returned from the entity configuration
+ * endpoint.
+ *
+ * @throws WebApplicationException
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ FederationConfigurationRequest request, Options options) throws WebApplicationException
{
// Call Authlete's /api/federation/configuration API.
FederationConfigurationResponse response =
- getApiCaller().callFederationConfiguration(request);
+ getApiCaller().callFederationConfiguration(request, options);
// 'action' in the response denotes the next action which
// the implementation of the endpoint should take.
diff --git a/src/main/java/com/authlete/jakarta/FederationRegistrationRequestHandler.java b/src/main/java/com/authlete/jakarta/FederationRegistrationRequestHandler.java
index b89161c..7300703 100644
--- a/src/main/java/com/authlete/jakarta/FederationRegistrationRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/FederationRegistrationRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2022 Authlete, Inc.
+ * Copyright (C) 2022-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.FederationRegistrationRequest;
import com.authlete.common.dto.FederationRegistrationResponse;
import com.authlete.common.dto.FederationRegistrationResponse.Action;
@@ -54,7 +55,9 @@ public FederationRegistrationRequestHandler(AuthleteApi api)
/**
- * Handle a request to the federation registration endpoint.
+ * Handle a request to the federation registration endpoint. This method is
+ * an alias of {@link #handle(FederationRegistrationRequest, Options) handle}{@code
+ * (request, null)}.
*
* @param request
* An "explicit" client registration request.
@@ -66,10 +69,34 @@ public FederationRegistrationRequestHandler(AuthleteApi api)
* @throws WebApplicationException
*/
public Response handle(FederationRegistrationRequest request) throws WebApplicationException
+ {
+ return handle(request, null);
+ }
+
+
+ /**
+ * Handle a request to the federation registration endpoint.
+ *
+ * @param request
+ * An "explicit" client registration request.
+ *
+ * @param options
+ * Request options for the {@code /api/federation/registration} API.
+ *
+ * @return
+ * A response that should be returned from the federation
+ * registration endpoint.
+ *
+ * @throws WebApplicationException
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ FederationRegistrationRequest request, Options options) throws WebApplicationException
{
// Call Authlete's /api/federation/registration API.
FederationRegistrationResponse response =
- getApiCaller().callFederationRegistration(request);
+ getApiCaller().callFederationRegistration(request, options);
// 'action' in the response denotes the next action which
// the implementation of the endpoint should take.
diff --git a/src/main/java/com/authlete/jakarta/GMRequestHandler.java b/src/main/java/com/authlete/jakarta/GMRequestHandler.java
index cf371e8..c6f9c3a 100644
--- a/src/main/java/com/authlete/jakarta/GMRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/GMRequestHandler.java
@@ -22,6 +22,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.GMRequest;
import com.authlete.common.dto.GMResponse;
import com.authlete.common.dto.GMResponse.Action;
@@ -54,7 +55,8 @@ public GMRequestHandler(AuthleteApi api)
/**
- * Handle a grant management request.
+ * Handle a grant management request. This method is an alias of the {@link
+ * #handle(GMRequest, Options) handle}{@code (request, null)}.
*
* @param request
* A grant management request.
@@ -66,9 +68,33 @@ public GMRequestHandler(AuthleteApi api)
* @throws WebApplicationException
*/
public Response handle(GMRequest request) throws WebApplicationException
+ {
+ return handle(request, null);
+ }
+
+
+ /**
+ * Handle a grant management request.
+ *
+ * @param request
+ * A grant management request.
+ *
+ * @param options
+ * Request options for the {@code /api/gm} API.
+ *
+ * @return
+ * A response that should be returned from the grant management
+ * endpoint to the client application.
+ *
+ * @throws WebApplicationException
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ GMRequest request, Options options) throws WebApplicationException
{
// Call Authlete's /api/gm API.
- GMResponse response = getApiCaller().callGm(request);
+ GMResponse response = getApiCaller().callGm(request, options);
// 'action' in the response denotes the next action which
// the implementation of grant management endpoint should take.
diff --git a/src/main/java/com/authlete/jakarta/IntrospectionRequestHandler.java b/src/main/java/com/authlete/jakarta/IntrospectionRequestHandler.java
index 5094516..7b765ee 100644
--- a/src/main/java/com/authlete/jakarta/IntrospectionRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/IntrospectionRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2017-2023 Authlete, Inc.
+ * Copyright (C) 2017-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -23,6 +23,7 @@
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.StandardIntrospectionResponse;
import com.authlete.common.dto.StandardIntrospectionResponse.Action;
import com.authlete.common.types.JWEAlg;
@@ -468,33 +469,61 @@ public IntrospectionRequestHandler(AuthleteApi api)
/**
* Handle an introspection request (RFC 7662).
+ * >RFC 7662). This method is an alias of {@link #handle(MultivaluedMap, Options)
+ * handle}{@code (parameters, null)}.
*
- * This method is an alias of the {@link #handle(Params)} method.
+ * @param parameters
+ * Request parameters of an introspection request.
+ *
+ * @return
+ * A response that should be returned from the endpoint to
+ * the resource server.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ */
+ public Response handle(
+ MultivaluedMap parameters) throws WebApplicationException
+ {
+ return handle(parameters, null);
+ }
+
+
+ /**
+ * Handle an introspection request (RFC 7662). This method is an alias of the {@link #handle(Params, Options)}
+ * method.
*
* @param parameters
* Request parameters of an introspection request.
*
+ * @param options
+ * Request options for the {@code /api/auth/introspection/standard} API.
+ *
* @return
* A response that should be returned from the endpoint to
* the resource server.
*
* @throws WebApplicationException
* An error occurred.
+ *
+ * @since 2.82
*/
- public Response handle(MultivaluedMap parameters) throws WebApplicationException
+ public Response handle(
+ MultivaluedMap parameters, Options options) throws WebApplicationException
{
Params params = new Params()
.setParameters(parameters)
;
- return handle(params);
+ return handle(params, options);
}
/**
* Handle an introspection request (RFC 7662).
+ * >RFC 7662). This method is an alias of {@link #handle(Params, Options)
+ * handle}{@code (params, null)}.
*
* @param params
* Parameters needed to handle the introspection request.
@@ -510,6 +539,32 @@ public Response handle(MultivaluedMap parameters) throws WebAppl
* @since 2.63
*/
public Response handle(Params params) throws WebApplicationException
+ {
+ return handle(params, null);
+ }
+
+
+ /**
+ * Handle an introspection request (RFC 7662).
+ *
+ * @param params
+ * Parameters needed to handle the introspection request.
+ * Must not be {@code null}.
+ *
+ * @param options
+ * Request options for the {@code /api/auth/introspection/standard} API.
+ *
+ * @return
+ * A response that should be returned from the endpoint to
+ * the resource server.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(Params params, Options options) throws WebApplicationException
{
try
{
@@ -524,7 +579,8 @@ public Response handle(Params params) throws WebApplicationException
params.getIntrospectionEncryptionEnc(),
params.getSharedKeyForSign(),
params.getSharedKeyForEncryption(),
- params.getPublicKeyForEncryption()
+ params.getPublicKeyForEncryption(),
+ options
);
}
catch (WebApplicationException e)
@@ -545,13 +601,13 @@ public Response handle(Params params) throws WebApplicationException
private Response process(
MultivaluedMap parameters, boolean withHiddenProperties, String httpAcceptHeader,
URI rsUri, JWSAlg introspectionSignAlg, JWEAlg introspectionEncAlg, JWEEnc introspectionEncEnc,
- String sharedKeyForSign, String sharedKeyForEncryption, String publicKeyForEncryption)
+ String sharedKeyForSign, String sharedKeyForEncryption, String publicKeyForEncryption, Options options)
{
// Call Authlete's /api/auth/introspection/standard API.
StandardIntrospectionResponse response = getApiCaller().callStandardIntrospection(
parameters, withHiddenProperties, httpAcceptHeader, rsUri, introspectionSignAlg,
introspectionEncAlg, introspectionEncEnc, sharedKeyForSign, sharedKeyForEncryption,
- publicKeyForEncryption);
+ publicKeyForEncryption, options);
// 'action' in the response denotes the next action which
// this service implementation should take.
diff --git a/src/main/java/com/authlete/jakarta/JwksRequestHandler.java b/src/main/java/com/authlete/jakarta/JwksRequestHandler.java
index e241397..b858066 100644
--- a/src/main/java/com/authlete/jakarta/JwksRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/JwksRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016 Authlete, Inc.
+ * Copyright (C) 2016-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -20,6 +20,7 @@
import jakarta.ws.rs.WebApplicationException;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
/**
@@ -57,7 +58,7 @@ public JwksRequestHandler(AuthleteApi api)
/**
* Handle a request to a JWK Set endpoint. This method is an alias
- * of {@link #handle(boolean) handle}{@code (true)}.
+ * of {@link #handle(Options) handle}{@code (null)}.
*
* @return
* A response that should be returned from the endpoint to
@@ -68,7 +69,49 @@ public JwksRequestHandler(AuthleteApi api)
*/
public Response handle() throws WebApplicationException
{
- return handle(true);
+ return handle(null);
+ }
+
+
+ /**
+ * Handle a request to a JWK Set endpoint. This method is an alias
+ * of {@link #handle(boolean, Options) handle}{@code (true, options)}.
+ *
+ * @param options
+ * Request options for the {@code /api/service/jwks/get} API.
+ *
+ * @return
+ * A response that should be returned from the endpoint to
+ * the client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(Options options) throws WebApplicationException
+ {
+ return handle(true, options);
+ }
+
+
+ /**
+ * Handle a request to a JWK Set endpoint. This method is an alias
+ * of {@link #handle(boolean, Options) handle}{@code (pretty, null)}.
+ *
+ * @param pretty
+ * {@code true} to return the output JSON in pretty format.
+ *
+ * @return
+ * A response that should be returned from the endpoint to
+ * the client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ */
+ public Response handle(boolean pretty) throws WebApplicationException
+ {
+ return handle(pretty, null);
}
@@ -79,20 +122,25 @@ public Response handle() throws WebApplicationException
* @param pretty
* {@code true} to return the output JSON in pretty format.
*
+ * @param options
+ * Request options for the {@code /api/service/jwks/get} API.
+ *
* @return
* A response that should be returned from the endpoint to
* the client application.
*
* @throws WebApplicationException
* An error occurred.
+ *
+ * @since 2.82
*/
- public Response handle(boolean pretty) throws WebApplicationException
+ public Response handle(boolean pretty, Options options) throws WebApplicationException
{
try
{
// Call Authlete's /api/service/jwks/get API. It returns the JWK Set
// of the service. Of course, private keys are not included.
- return getApiCaller().serviceJwksGet(pretty, false);
+ return getApiCaller().serviceJwksGet(pretty, false, options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/PushedAuthReqHandler.java b/src/main/java/com/authlete/jakarta/PushedAuthReqHandler.java
index 4afa3d8..a78cbbd 100644
--- a/src/main/java/com/authlete/jakarta/PushedAuthReqHandler.java
+++ b/src/main/java/com/authlete/jakarta/PushedAuthReqHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2019-2023 Authlete, Inc.
+ * Copyright (C) 2019-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.PushedAuthReqResponse;
import com.authlete.common.dto.PushedAuthReqResponse.Action;
import com.authlete.common.web.BasicCredentials;
@@ -310,7 +311,9 @@ public PushedAuthReqHandler(AuthleteApi api)
/**
- * Handle a pushed authorization request.
+ * Handle a pushed authorization request. This method is an alias
+ * of {@link #handle(MultivaluedMap, String, String[], Options) handle}{@code
+ * (parameters, authorization, clientCertificatePath, null)}.
*
* @param parameters
* Request parameters of a pushed authorization request.
@@ -337,6 +340,45 @@ public PushedAuthReqHandler(AuthleteApi api)
public Response handle(
MultivaluedMap parameters, String authorization,
String[] clientCertificatePath) throws WebApplicationException
+ {
+ return handle(parameters, authorization, clientCertificatePath, null);
+ }
+
+
+ /**
+ * Handle a pushed authorization request. This method is an alias of the {@link
+ * #handle(Params, Options)} method.
+ *
+ * @param parameters
+ * Request parameters of a pushed authorization request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header in the pushed
+ * authorization request. A client application may embed its
+ * pair of client ID and client secret in a pushed authorization
+ * request using Basic Authentication.
+ *
+ * @param clientCertificatePath
+ * The path of the client's certificate, each in PEM format.
+ * The first item in the array is the client's certificate itself.
+ * May be {@code null} if the client did not send a certificate or path.
+ *
+ * @param options
+ * Request options for the {@code /api/pushed_auth_req} API.
+ *
+ * @return
+ * A response that should be returned from the endpoint to the
+ * client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ MultivaluedMap parameters, String authorization,
+ String[] clientCertificatePath, Options options) throws WebApplicationException
{
Params params = new Params()
.setParameters(parameters)
@@ -344,12 +386,13 @@ public Response handle(
.setClientCertificatePath(clientCertificatePath)
;
- return handle(params);
+ return handle(params, options);
}
/**
- * Handle a PAR request.
+ * Handle a PAR request. This method is an alias of {@link #handle(Params, Options)
+ * handle}{@code (params, null)}.
*
* @param params
* Parameters needed to handle the PAR request.
@@ -365,6 +408,31 @@ public Response handle(
* @since 2.69
*/
public Response handle(Params params)
+ {
+ return handle(params, null);
+ }
+
+
+ /**
+ * Handle a PAR request.
+ *
+ * @param params
+ * Parameters needed to handle the PAR request.
+ * Must not be {@code null}.
+ *
+ * @param options
+ * Request options for the {@code /api/pushed_auth_req} API.
+ *
+ * @return
+ * A response that should be returned from the endpoint to the
+ * client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(Params params, Options options)
{
// Convert the value of Authorization header (credentials of
// the client application), if any, into BasicCredentials.
@@ -385,7 +453,8 @@ public Response handle(Params params)
params.getClientCertificatePath(),
params.getDpop(),
params.getHtm(),
- params.getHtu()
+ params.getHtu(),
+ options
);
}
catch (WebApplicationException e)
@@ -406,7 +475,7 @@ public Response handle(Params params)
private Response process(
MultivaluedMap parameters, String clientId,
String clientSecret, String[] clientCertificatePath,
- String dpop, String htm, String htu)
+ String dpop, String htm, String htu, Options options)
{
String clientCertificate = null;
if (clientCertificatePath != null && clientCertificatePath.length > 0)
@@ -424,7 +493,7 @@ private Response process(
PushedAuthReqResponse response = getApiCaller().callPushedAuthReq(
parameters, clientId, clientSecret,
- clientCertificate, clientCertificatePath, dpop, htm, htu);
+ clientCertificate, clientCertificatePath, dpop, htm, htu, options);
// 'action' in the response denotes the next action which
// this service implementation should take.
diff --git a/src/main/java/com/authlete/jakarta/RevocationRequestHandler.java b/src/main/java/com/authlete/jakarta/RevocationRequestHandler.java
index c804b47..9001b92 100644
--- a/src/main/java/com/authlete/jakarta/RevocationRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/RevocationRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2016 Authlete, Inc.
+ * Copyright (C) 2015-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,7 @@
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.RevocationResponse;
import com.authlete.common.dto.RevocationResponse.Action;
import com.authlete.common.web.BasicCredentials;
@@ -62,6 +63,35 @@ public RevocationRequestHandler(AuthleteApi api)
}
+ /**
+ * Handle a token revocation request (RFC 7009). This method is an alias of {@link #handle(MultivaluedMap, String, Options)
+ * handle}{@code (parameters, authorization, null)}.
+ *
+ * @param parameters
+ * Request parameters of a token revocation request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header in the token revocation
+ * request. A client application may embed its pair of client ID and
+ * client secret in a token revocation request using Basic
+ * Authentication.
+ *
+ * @return
+ * A response that should be returned from the endpoint to the
+ * client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ */
+ public Response handle(
+ MultivaluedMap parameters, String authorization) throws WebApplicationException
+ {
+ return handle(parameters, authorization, null);
+ }
+
+
/**
* Handle a token revocation request (RFC 7009).
@@ -76,14 +106,21 @@ public RevocationRequestHandler(AuthleteApi api)
* "https://tools.ietf.org/html/rfc2617#section-2">Basic
* Authentication.
*
+ * @param options
+ * Request options for the {@code /api/auth/revocation} API.
+ *
* @return
* A response that should be returned from the endpoint to the
* client application.
*
* @throws WebApplicationException
* An error occurred.
+ *
+ * @since 2.82
*/
- public Response handle(MultivaluedMap parameters, String authorization) throws WebApplicationException
+ public Response handle(
+ MultivaluedMap parameters, String authorization,
+ Options options) throws WebApplicationException
{
// Convert the value of Authorization header (credentials of
// the client application), if any, into BasicCredentials.
@@ -97,7 +134,7 @@ public Response handle(MultivaluedMap parameters, String authori
try
{
// Process the given parameters.
- return process(parameters, clientId, clientSecret);
+ return process(parameters, clientId, clientSecret, options);
}
catch (WebApplicationException e)
{
@@ -114,10 +151,12 @@ public Response handle(MultivaluedMap parameters, String authori
/**
* Process the parameters of the revocation request.
*/
- private Response process(MultivaluedMap parameters, String clientId, String clientSecret)
+ private Response process(
+ MultivaluedMap parameters, String clientId, String clientSecret, Options options)
{
// Call Authlete's /api/auth/revocation API.
- RevocationResponse response = getApiCaller().callRevocation(parameters, clientId, clientSecret);
+ RevocationResponse response = getApiCaller()
+ .callRevocation(parameters, clientId, clientSecret, options);
// 'action' in the response denotes the next action which
// this service implementation should take.
diff --git a/src/main/java/com/authlete/jakarta/TokenRequestHandler.java b/src/main/java/com/authlete/jakarta/TokenRequestHandler.java
index 9823d4b..a23ad4f 100644
--- a/src/main/java/com/authlete/jakarta/TokenRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/TokenRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2015-2023 Authlete, Inc.
+ * Copyright (C) 2015-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.dto.Property;
import com.authlete.common.dto.TokenFailRequest.Reason;
import com.authlete.common.dto.TokenResponse;
@@ -322,9 +323,9 @@ public TokenRequestHandler(AuthleteApi api, TokenRequestHandlerSpi spi)
/**
- * Handle a token request.
- *
- * This method is an alias of the {@link #handle(Params)} method.
+ * Handle a token request. This method is an alias of {@link
+ * #handle(MultivaluedMap, String, Options, Options, Options) handle}{@code
+ * (parameters, authorization, null, null, null)}.
*
* @param parameters
* Request parameters of a token request.
@@ -346,19 +347,55 @@ public TokenRequestHandler(AuthleteApi api, TokenRequestHandlerSpi spi)
public Response handle(
MultivaluedMap parameters, String authorization) throws WebApplicationException
{
- Params params = new Params()
- .setParameters(parameters)
- .setAuthorization(authorization)
- ;
-
- return handle(params);
+ return handle(parameters, authorization, null, null, null);
}
/**
- * Handle a token request.
+ * Handle a token request. This method is an alias of {@link
+ * #handle(MultivaluedMap, String, String[], Options, Options, Options) handle}{@code
+ * (parameters, authorization, null, tokenOpts, tokenIssueOpts, tokenFailOpts)}.
+ *
+ * @param parameters
+ * Request parameters of a token request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header in the token request.
+ * A client application may embed its pair of client ID and client
+ * secret in a token request using Basic
+ * Authentication.
*
- * This method is an alias of the {@link #handle(Params)} method.
+ * @param tokenOpts
+ * Request options for the {@code /api/auth/token} API.
+ *
+ * @param tokenIssueOpts
+ * Request options for the {@code /api/auth/token/issue} API.
+ *
+ * @param tokenFailOpts
+ * Request options for the {@code /api/auth/token/fail} API.
+ *
+ * @return
+ * A response that should be returned from the endpoint to the
+ * client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ MultivaluedMap parameters, String authorization,
+ Options tokenOpts, Options tokenIssueOpts, Options tokenFailOpts)
+ throws WebApplicationException
+ {
+ return handle(parameters, authorization, null, tokenOpts, tokenIssueOpts, tokenFailOpts);
+ }
+
+
+ /**
+ * Handle a token request. This method is an alias of {@link #handle(MultivaluedMap, String, String[], Options, Options, Options)
+ * handle}{@code (parameters, authorization, clientCertificatePath, null, null, null)}.
*
* @param parameters
* Request parameters of a token request.
@@ -387,6 +424,52 @@ public Response handle(
public Response handle(
MultivaluedMap parameters, String authorization,
String[] clientCertificatePath) throws WebApplicationException
+ {
+ return handle(parameters, authorization, clientCertificatePath, null, null, null);
+ }
+
+
+ /**
+ * Handle a token request. This method is an alias of the {@link #handle(Params,
+ * Options, Options, Options)} method.
+ *
+ * @param parameters
+ * Request parameters of a token request.
+ *
+ * @param authorization
+ * The value of {@code Authorization} header in the token request.
+ * A client application may embed its pair of client ID and client
+ * secret in a token request using Basic
+ * Authentication.
+ *
+ * @param clientCertificatePath
+ * The path of the client's certificate, each in PEM format. The first
+ * item in the array is the client's certificate itself. May be {@code null} if
+ * the client did not send a certificate or path.
+ *
+ * @param tokenOpts
+ * Request options for the {@code /api/auth/token} API.
+ *
+ * @param tokenIssueOpts
+ * Request options for the {@code /api/auth/token/issue} API.
+ *
+ * @param tokenFailOpts
+ * Request options for the {@code /api/auth/token/fail} API.
+ *
+ * @return
+ * A response that should be returned from the endpoint to the
+ * client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ MultivaluedMap parameters, String authorization,
+ String[] clientCertificatePath, Options tokenOpts, Options tokenIssueOpts,
+ Options tokenFailOpts) throws WebApplicationException
{
Params params = new Params()
.setParameters(parameters)
@@ -394,12 +477,13 @@ public Response handle(
.setClientCertificatePath(clientCertificatePath)
;
- return handle(params);
+ return handle(params, tokenOpts, tokenIssueOpts, tokenFailOpts);
}
/**
- * Handle a token request.
+ * Handle a token request. This method is an alias of the {@link #handle(Params,
+ * Options, Options, Options) handle}{@code (params, null, null, null)}.
*
* @param params
* Parameters needed to handle the token request.
@@ -415,6 +499,39 @@ public Response handle(
* @since 2.27
*/
public Response handle(Params params) throws WebApplicationException
+ {
+ return handle(params, null, null, null);
+ }
+
+
+ /**
+ * Handle a token request.
+ *
+ * @param params
+ * Parameters needed to handle the token request.
+ * Must not be {@code null}.
+ *
+ * @param tokenOpts
+ * Request options for the {@code /api/auth/token} API.
+ *
+ * @param tokenIssueOpts
+ * Request options for the {@code /api/auth/token/issue} API.
+ *
+ * @param tokenFailOpts
+ * Request options for the {@code /api/auth/token/fail} API.
+ *
+ * @return
+ * A response that should be returned from the endpoint to the
+ * client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ Params params, Options tokenOpts, Options tokenIssueOpts, Options tokenFailOpts)
+ throws WebApplicationException
{
// Convert the value of Authorization header (credentials of
// the client application), if any, into BasicCredentials.
@@ -435,7 +552,10 @@ public Response handle(Params params) throws WebApplicationException
params.getClientCertificatePath(),
params.getDpop(),
params.getHtm(),
- params.getHtu()
+ params.getHtu(),
+ tokenOpts,
+ tokenIssueOpts,
+ tokenFailOpts
);
}
catch (WebApplicationException e)
@@ -456,7 +576,8 @@ public Response handle(Params params) throws WebApplicationException
private Response process(
MultivaluedMap parameters, String clientId,
String clientSecret, String[] clientCertificatePath,
- String dpop, String htm, String htu)
+ String dpop, String htm, String htu, Options tokenOpts, Options tokenIssueOpts,
+ Options tokenFailOpts)
{
// Extra properties to associate with an access token.
Property[] properties = mSpi.getProperties();
@@ -478,7 +599,7 @@ private Response process(
// Call Authlete's /api/auth/token API.
TokenResponse response = getApiCaller().callToken(
parameters, clientId, clientSecret, properties,
- clientCertificate, clientCertificatePath, dpop, htm, htu);
+ clientCertificate, clientCertificatePath, dpop, htm, htu, tokenOpts);
// 'action' in the response denotes the next action which
// this service implementation should take.
@@ -507,7 +628,7 @@ private Response process(
case PASSWORD:
// Process the token request whose flow is "Resource Owner Password Credentials".
- return handlePassword(response, headers);
+ return handlePassword(response, headers, tokenIssueOpts, tokenFailOpts);
case OK:
// 200 OK
@@ -552,7 +673,9 @@ private static Map prepareHeaders(TokenResponse response)
/**
* Process the token request whose flow is "Resource Owner Password Credentials".
*/
- private Response handlePassword(TokenResponse response, Map headers)
+ private Response handlePassword(
+ TokenResponse response, Map headers, Options tokenIssueOpts,
+ Options tokenFailOpts)
{
// The credentials of the resource owner.
String username = response.getUsername();
@@ -571,13 +694,14 @@ private Response handlePassword(TokenResponse response, Map head
{
// Issue an access token and optionally an ID token.
return getApiCaller().tokenIssue(
- ticket, subject, properties, headers);
+ ticket, subject, properties, headers, tokenIssueOpts);
}
else
{
// The credentials are invalid. An access token is not issued.
throw getApiCaller().tokenFail(
- ticket, Reason.INVALID_RESOURCE_OWNER_CREDENTIALS, headers);
+ ticket, Reason.INVALID_RESOURCE_OWNER_CREDENTIALS, headers,
+ tokenFailOpts);
}
}
diff --git a/src/main/java/com/authlete/jakarta/UserInfoRequestHandler.java b/src/main/java/com/authlete/jakarta/UserInfoRequestHandler.java
index f338b57..93c90af 100644
--- a/src/main/java/com/authlete/jakarta/UserInfoRequestHandler.java
+++ b/src/main/java/com/authlete/jakarta/UserInfoRequestHandler.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2016-2023 Authlete, Inc.
+ * Copyright (C) 2016-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -25,6 +25,7 @@
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.Response.Status;
import com.authlete.common.api.AuthleteApi;
+import com.authlete.common.api.Options;
import com.authlete.common.assurance.VerifiedClaims;
import com.authlete.common.assurance.constraint.VerifiedClaimsConstraint;
import com.authlete.common.assurance.constraint.VerifiedClaimsContainerConstraint;
@@ -418,7 +419,8 @@ public UserInfoRequestHandler(AuthleteApi api, UserInfoRequestHandlerSpi spi)
* "http://openid.net/specs/openid-connect-core-1_0.html#UserInfo"
* >UserInfo Endpoint defined in OpenID Connect
- * Core 1.0.
+ * Core 1.0. This method is an alias of {@link #handle(String, Options, Options)
+ * handle}{@code (accessToken, null, null)}.
*
* @param accessToken
* An access token.
@@ -431,17 +433,52 @@ public UserInfoRequestHandler(AuthleteApi api, UserInfoRequestHandlerSpi spi)
* An error occurred.
*/
public Response handle(String accessToken) throws WebApplicationException
+ {
+ return handle(accessToken, null, null);
+ }
+
+
+ /**
+ * Handle a userinfo request to a UserInfo Endpoint defined in OpenID Connect
+ * Core 1.0. This method is an alias of the {@link
+ * #handle(Params, Options, Options)} method.
+ *
+ * @param accessToken
+ * An access token.
+ *
+ * @param userInfoOpts
+ * Request options for the {@code /api/auth/userinfo} API.
+ *
+ * @param userInfoIssueOpts
+ * Request options for the {@code /api/auth/userinfo/issue} API.
+ *
+ * @return
+ * A response that should be returned from the endpoint to the
+ * client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ String accessToken, Options userInfoOpts, Options userInfoIssueOpts)
+ throws WebApplicationException
{
Params params = new Params()
.setAccessToken(accessToken)
;
- return handle(params);
+ return handle(params, userInfoOpts, userInfoIssueOpts);
}
/**
- * Handle a userinfo request.
+ * Handle a userinfo request. This method is an alias of {@link #handle(Params, Options, Options)
+ * handle}{@code (params, null, null)}.
*
* @param params
* Parameters needed to handle the userinfo request.
@@ -454,6 +491,35 @@ public Response handle(String accessToken) throws WebApplicationException
* An error occurred.
*/
public Response handle(Params params) throws WebApplicationException
+ {
+ return handle(params, null, null);
+ }
+
+
+ /**
+ * Handle a userinfo request.
+ *
+ * @param params
+ * Parameters needed to handle the userinfo request.
+ *
+ * @param userInfoOpts
+ * Request options for the {@code /api/auth/userinfo} API.
+ *
+ * @param userInfoIssueOpts
+ * Request options for the {@code /api/auth/userinfo/issue} API.
+ *
+ * @return
+ * A response that should be returned from the endpoint to the
+ * client application.
+ *
+ * @throws WebApplicationException
+ * An error occurred.
+ *
+ * @since 2.82
+ */
+ public Response handle(
+ Params params, Options userInfoOpts, Options userInfoIssueOpts)
+ throws WebApplicationException
{
// If an access token is not available.
if (params == null || params.getAccessToken() == null)
@@ -466,7 +532,7 @@ public Response handle(Params params) throws WebApplicationException
try
{
// Process the userinfo request.
- return process(params);
+ return process(params, userInfoOpts, userInfoIssueOpts);
}
catch (WebApplicationException e)
{
@@ -483,7 +549,7 @@ public Response handle(Params params) throws WebApplicationException
/**
* Process the userinfo request with the access token.
*/
- private Response process(Params params)
+ private Response process(Params params, Options userInfoOpts, Options userInfoIssueOpts)
{
// Call Authlete's /api/auth/userinfo API.
UserInfoResponse response = getApiCaller().callUserInfo(
@@ -491,7 +557,8 @@ private Response process(Params params)
params.getClientCertificate(),
params.getDpop(),
params.getHtm(),
- params.getHtu()
+ params.getHtu(),
+ userInfoOpts
);
// 'action' in the response denotes the next action which
@@ -525,7 +592,7 @@ private Response process(Params params)
case OK:
// Return the user information.
- return getUserInfo(params, response, headers);
+ return getUserInfo(params, response, headers, userInfoIssueOpts);
default:
// This never happens.
@@ -554,7 +621,8 @@ private static Map prepareHeaders(UserInfoResponse response)
* Authlete's {@code /api/auth/userinfo/issue} API.
*/
private Response getUserInfo(
- Params params, UserInfoResponse response, Map headers)
+ Params params, UserInfoResponse response, Map headers,
+ Options options)
{
String subject = response.getSubject();
@@ -592,7 +660,7 @@ private Response getUserInfo(
// Generate a JSON or a JWT containing user information
// by calling Authlete's /api/auth/userinfo/issue API.
return getApiCaller().userInfoIssue(
- response.getToken(), claims, claimsForTx, verifiedClaimsForTx, headers);
+ response.getToken(), claims, claimsForTx, verifiedClaimsForTx, headers, options);
}
catch (WebApplicationException e)
{
diff --git a/src/main/java/com/authlete/jakarta/api/AuthleteApiImpl.java b/src/main/java/com/authlete/jakarta/api/AuthleteApiImpl.java
index 966e18a..ba702f2 100644
--- a/src/main/java/com/authlete/jakarta/api/AuthleteApiImpl.java
+++ b/src/main/java/com/authlete/jakarta/api/AuthleteApiImpl.java
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2014-2023 Authlete, Inc.
+ * Copyright (C) 2014-2025 Authlete, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,10 +21,12 @@
import static jakarta.ws.rs.core.MediaType.APPLICATION_JSON_TYPE;
import java.util.LinkedHashMap;
import java.util.Map;
+import jakarta.ws.rs.client.Invocation.Builder;
import jakarta.ws.rs.client.WebTarget;
import jakarta.ws.rs.core.GenericType;
import com.authlete.common.api.AuthleteApi;
import com.authlete.common.api.AuthleteApiException;
+import com.authlete.common.api.Options;
import com.authlete.common.conf.AuthleteApiVersion;
import com.authlete.common.conf.AuthleteConfiguration;
import com.authlete.common.dto.*;
@@ -202,40 +204,40 @@ private String createServiceCredentials(AuthleteConfiguration configuration)
private TResponse callServiceOwnerGetApi(
- String path, Class responseClass, Map params)
+ String path, Class responseClass, Map params, Options options)
{
- return callGetApi(mServiceOwnerAuth, path, responseClass, params);
+ return callGetApi(mServiceOwnerAuth, path, responseClass, params, options);
}
private TResponse callServiceGetApi(
- String path, Class responseClass, Map params)
+ String path, Class responseClass, Map params, Options options)
{
- return callGetApi(mServiceAuth, path, responseClass, params);
+ return callGetApi(mServiceAuth, path, responseClass, params, options);
}
- private Void callServiceOwnerDeleteApi(String path)
+ private Void callServiceOwnerDeleteApi(String path, Options options)
{
- return callDeleteApi(mServiceOwnerAuth, path);
+ return callDeleteApi(mServiceOwnerAuth, path, options);
}
- private Void callServiceDeleteApi(String path)
+ private Void callServiceDeleteApi(String path, Options options)
{
- return callDeleteApi(mServiceAuth, path);
+ return callDeleteApi(mServiceAuth, path, options);
}
- private TResponse callServiceOwnerPostApi(String path, Object request, Class responseClass)
+ private TResponse callServiceOwnerPostApi(String path, Object request, Class responseClass, Options options)
{
- return callPostApi(mServiceOwnerAuth, path, request, responseClass);
+ return callPostApi(mServiceOwnerAuth, path, request, responseClass, options);
}
- private TResponse callServicePostApi(String path, Object request, Class responseClass)
+ private TResponse callServicePostApi(String path, Object request, Class responseClass, Options options)
{
- return callPostApi(mServiceAuth, path, request, responseClass);
+ return callPostApi(mServiceAuth, path, request, responseClass, options);
}
@@ -245,6 +247,7 @@ private static abstract class ApiCaller implements AuthleteApiCall mResponseClass;
protected final Map mParams = new LinkedHashMap<>();
+ protected Options mOptions;
ApiCaller(Class responseClass, Object request, String path)
@@ -267,6 +270,14 @@ public ApiCaller addParam(String name, Object... values)
return this;
}
+
+
+ public ApiCaller setOptions(Options options)
+ {
+ mOptions = options;
+
+ return this;
+ }
}
@@ -287,7 +298,7 @@ private class ServiceOwnerDeleteApiCaller extends ApiCaller
@Override
public Void call()
{
- return callServiceOwnerDeleteApi(mPath);
+ return callServiceOwnerDeleteApi(mPath, mOptions);
}
}
@@ -309,7 +320,7 @@ private class ServiceOwnerGetApiCaller extends ApiCaller
@Override
public TResponse call()
{
- return callServiceOwnerGetApi(mPath, mResponseClass, mParams);
+ return callServiceOwnerGetApi(mPath, mResponseClass, mParams, mOptions);
}
}
@@ -331,7 +342,7 @@ private class ServiceOwnerPostApiCaller extends ApiCaller
@Override
public TResponse call()
{
- return callServiceOwnerPostApi(mPath, mRequest, mResponseClass);
+ return callServiceOwnerPostApi(mPath, mRequest, mResponseClass, mOptions);
}
}
@@ -353,7 +364,7 @@ private class ServiceDeleteApiCaller extends ApiCaller
@Override
public Void call()
{
- return callServiceDeleteApi(mPath);
+ return callServiceDeleteApi(mPath, mOptions);
}
}
@@ -375,7 +386,7 @@ private class ServiceGetApiCaller extends ApiCaller
@Override
public TResponse call()
{
- return callServiceGetApi(mPath, mResponseClass, mParams);
+ return callServiceGetApi(mPath, mResponseClass, mParams, mOptions);
}
}
@@ -397,7 +408,7 @@ private class ServicePostApiCaller extends ApiCaller
@Override
public TResponse call()
{
- return callServicePostApi(mPath, mRequest, mResponseClass);
+ return callServicePostApi(mPath, mRequest, mResponseClass, mOptions);
}
}
@@ -406,11 +417,12 @@ public TResponse call()
* Call {@code /api/auth/authorization} API.
*/
@Override
- public AuthorizationResponse authorization(AuthorizationRequest request) throws AuthleteApiException
+ public AuthorizationResponse authorization(AuthorizationRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- AuthorizationResponse.class, request, AUTH_AUTHORIZATION_API_PATH));
+ AuthorizationResponse.class, request, AUTH_AUTHORIZATION_API_PATH)
+ .setOptions(options));
}
@@ -418,11 +430,12 @@ public AuthorizationResponse authorization(AuthorizationRequest request) throws
* Call {@code /api/auth/authorization/fail} API.
*/
@Override
- public AuthorizationFailResponse authorizationFail(AuthorizationFailRequest request) throws AuthleteApiException
+ public AuthorizationFailResponse authorizationFail(AuthorizationFailRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- AuthorizationFailResponse.class, request, AUTH_AUTHORIZATION_FAIL_API_PATH));
+ AuthorizationFailResponse.class, request, AUTH_AUTHORIZATION_FAIL_API_PATH)
+ .setOptions(options));
}
@@ -430,11 +443,12 @@ public AuthorizationFailResponse authorizationFail(AuthorizationFailRequest requ
* Call {@code /api/auth/authorization/issue} API.
*/
@Override
- public AuthorizationIssueResponse authorizationIssue(AuthorizationIssueRequest request) throws AuthleteApiException
+ public AuthorizationIssueResponse authorizationIssue(AuthorizationIssueRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- AuthorizationIssueResponse.class, request, AUTH_AUTHORIZATION_ISSUE_API_PATH));
+ AuthorizationIssueResponse.class, request, AUTH_AUTHORIZATION_ISSUE_API_PATH)
+ .setOptions(options));
}
@@ -442,11 +456,12 @@ public AuthorizationIssueResponse authorizationIssue(AuthorizationIssueRequest r
* Call {@code /api/auth/token} API.
*/
@Override
- public TokenResponse token(TokenRequest request) throws AuthleteApiException
+ public TokenResponse token(TokenRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- TokenResponse.class, request, AUTH_TOKEN_API_PATH));
+ TokenResponse.class, request, AUTH_TOKEN_API_PATH)
+ .setOptions(options));
}
@@ -454,11 +469,12 @@ public TokenResponse token(TokenRequest request) throws AuthleteApiException
* Call {@code /api/auth/token/create} API.
*/
@Override
- public TokenCreateResponse tokenCreate(TokenCreateRequest request) throws AuthleteApiException
+ public TokenCreateResponse tokenCreate(TokenCreateRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- TokenCreateResponse.class, request, AUTH_TOKEN_CREATE_API_PATH));
+ TokenCreateResponse.class, request, AUTH_TOKEN_CREATE_API_PATH)
+ .setOptions(options));
}
@@ -466,11 +482,12 @@ public TokenCreateResponse tokenCreate(TokenCreateRequest request) throws Authle
* Call /api/auth/token/delete/{token}
API.
*/
@Override
- public void tokenDelete(String token) throws AuthleteApiException
+ public void tokenDelete(String token, Options options) throws AuthleteApiException
{
executeApiCall(
new ServiceDeleteApiCaller(
- AUTH_TOKEN_DELETE_API_PATH, token));
+ AUTH_TOKEN_DELETE_API_PATH, token)
+ .setOptions(options));
}
@@ -478,11 +495,12 @@ public void tokenDelete(String token) throws AuthleteApiException
* Call {@code /api/auth/token/fail} API.
*/
@Override
- public TokenFailResponse tokenFail(TokenFailRequest request) throws AuthleteApiException
+ public TokenFailResponse tokenFail(TokenFailRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- TokenFailResponse.class, request, AUTH_TOKEN_FAIL_API_PATH));
+ TokenFailResponse.class, request, AUTH_TOKEN_FAIL_API_PATH)
+ .setOptions(options));
}
@@ -490,11 +508,12 @@ public TokenFailResponse tokenFail(TokenFailRequest request) throws AuthleteApiE
* Call {@code /api/auth/token/issue} API.
*/
@Override
- public TokenIssueResponse tokenIssue(TokenIssueRequest request) throws AuthleteApiException
+ public TokenIssueResponse tokenIssue(TokenIssueRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- TokenIssueResponse.class, request, AUTH_TOKEN_ISSUE_API_PATH));
+ TokenIssueResponse.class, request, AUTH_TOKEN_ISSUE_API_PATH)
+ .setOptions(options));
}
@@ -502,11 +521,12 @@ public TokenIssueResponse tokenIssue(TokenIssueRequest request) throws AuthleteA
* Call {@code /api/auth/token/revoke} API.
*/
@Override
- public TokenRevokeResponse tokenRevoke(TokenRevokeRequest request) throws AuthleteApiException
+ public TokenRevokeResponse tokenRevoke(TokenRevokeRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- TokenRevokeResponse.class, request, AUTH_TOKEN_REVOKE_API_PATH));
+ TokenRevokeResponse.class, request, AUTH_TOKEN_REVOKE_API_PATH)
+ .setOptions(options));
}
@@ -514,87 +534,88 @@ public TokenRevokeResponse tokenRevoke(TokenRevokeRequest request) throws Authle
* Call {@code /api/auth/token/update} API.
*/
@Override
- public TokenUpdateResponse tokenUpdate(TokenUpdateRequest request) throws AuthleteApiException
+ public TokenUpdateResponse tokenUpdate(TokenUpdateRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- TokenUpdateResponse.class, request, AUTH_TOKEN_UPDATE_API_PATH));
+ TokenUpdateResponse.class, request, AUTH_TOKEN_UPDATE_API_PATH)
+ .setOptions(options));
}
@Override
- public TokenListResponse getTokenList() throws AuthleteApiException
+ public TokenListResponse getTokenList(Options options) throws AuthleteApiException
{
- return getTokenList(null, null, 0, 0, false, TokenStatus.ALL);
+ return getTokenList(null, null, 0, 0, false, TokenStatus.ALL, options);
}
@Override
- public TokenListResponse getTokenList(TokenStatus tokenStatus) throws AuthleteApiException
+ public TokenListResponse getTokenList(TokenStatus tokenStatus, Options options) throws AuthleteApiException
{
- return getTokenList(null, null, 0, 0, false, tokenStatus);
+ return getTokenList(null, null, 0, 0, false, tokenStatus, options);
}
@Override
- public TokenListResponse getTokenList(String clientIdentifier, String subject) throws AuthleteApiException
+ public TokenListResponse getTokenList(String clientIdentifier, String subject, Options options) throws AuthleteApiException
{
- return getTokenList(clientIdentifier, subject, 0, 0, false, TokenStatus.ALL);
+ return getTokenList(clientIdentifier, subject, 0, 0, false, TokenStatus.ALL, options);
}
@Override
- public TokenListResponse getTokenList(String clientIdentifier, String subject, TokenStatus tokenStatus) throws AuthleteApiException
+ public TokenListResponse getTokenList(String clientIdentifier, String subject, TokenStatus tokenStatus, Options options) throws AuthleteApiException
{
- return getTokenList(clientIdentifier, subject, 0, 0, false, tokenStatus);
+ return getTokenList(clientIdentifier, subject, 0, 0, false, tokenStatus, options);
}
@Override
- public TokenListResponse getTokenList(int start, int end) throws AuthleteApiException
+ public TokenListResponse getTokenList(int start, int end, Options options) throws AuthleteApiException
{
- return getTokenList(null, null, start, end, true, TokenStatus.ALL);
+ return getTokenList(null, null, start, end, true, TokenStatus.ALL, options);
}
@Override
- public TokenListResponse getTokenList(int start, int end, TokenStatus tokenStatus) throws AuthleteApiException
+ public TokenListResponse getTokenList(int start, int end, TokenStatus tokenStatus, Options options) throws AuthleteApiException
{
- return getTokenList(null, null, start, end, true, tokenStatus);
+ return getTokenList(null, null, start, end, true, tokenStatus, options);
}
@Override
- public TokenListResponse getTokenList(String clientIdentifier, String subject, int start, int end) throws AuthleteApiException
+ public TokenListResponse getTokenList(String clientIdentifier, String subject, int start, int end, Options options) throws AuthleteApiException
{
- return getTokenList(clientIdentifier, subject, start, end, true, TokenStatus.ALL);
+ return getTokenList(clientIdentifier, subject, start, end, true, TokenStatus.ALL, options);
}
@Override
- public TokenListResponse getTokenList(String clientIdentifier, String subject, int start, int end, TokenStatus tokenStatus) throws AuthleteApiException
+ public TokenListResponse getTokenList(String clientIdentifier, String subject, int start, int end, TokenStatus tokenStatus, Options options) throws AuthleteApiException
{
- return getTokenList(clientIdentifier, subject, start, end, true, tokenStatus);
+ return getTokenList(clientIdentifier, subject, start, end, true, tokenStatus, options);
}
private TokenListResponse getTokenList(
final String clientIdentifier, final String subject,
- final int start, final int end, final boolean rangeGiven, TokenStatus tokenStatus) throws AuthleteApiException
+ final int start, final int end, final boolean rangeGiven, TokenStatus tokenStatus, Options options) throws AuthleteApiException
{
return executeApiCall(new AuthleteApiCall()
{
@Override
public TokenListResponse call()
{
- return callGetTokenList(clientIdentifier, subject, start, end, rangeGiven, tokenStatus);
+ return callGetTokenList(clientIdentifier, subject, start, end, rangeGiven, tokenStatus, options);
}
});
}
private TokenListResponse callGetTokenList(
- String clientIdentifier, String subject, int start, int end, boolean rangeGiven, TokenStatus tokenStatus)
+ String clientIdentifier, String subject, int start, int end, boolean rangeGiven, TokenStatus tokenStatus, Options options)
{
WebTarget target = getTarget().path(AUTH_TOKEN_GET_LIST_API_PATH);
@@ -615,10 +636,13 @@ private TokenListResponse callGetTokenList(
target = target.queryParam("tokenStatus", tokenStatus.toString());
- return wrapWithDpop(target
+ Builder builder = wrapWithDpop(target
.request(APPLICATION_JSON_TYPE), AUTH_TOKEN_GET_LIST_API_PATH, "GET")
- .header(AUTHORIZATION, mServiceAuth)
- .get(TokenListResponse.class);
+ .header(AUTHORIZATION, mServiceAuth);
+
+ setCustomRequestHeaders(builder, options);
+
+ return builder.get(TokenListResponse.class);
}
@@ -626,11 +650,12 @@ private TokenListResponse callGetTokenList(
* Call {@code /api/auth/revocation} API.
*/
@Override
- public RevocationResponse revocation(RevocationRequest request) throws AuthleteApiException
+ public RevocationResponse revocation(RevocationRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- RevocationResponse.class, request, AUTH_REVOCATION_API_PATH));
+ RevocationResponse.class, request, AUTH_REVOCATION_API_PATH)
+ .setOptions(options));
}
@@ -638,11 +663,12 @@ public RevocationResponse revocation(RevocationRequest request) throws AuthleteA
* Call {@code /api/auth/userinfo} API.
*/
@Override
- public UserInfoResponse userinfo(UserInfoRequest request) throws AuthleteApiException
+ public UserInfoResponse userinfo(UserInfoRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- UserInfoResponse.class, request, AUTH_USERINFO_API_PATH));
+ UserInfoResponse.class, request, AUTH_USERINFO_API_PATH)
+ .setOptions(options));
}
@@ -650,11 +676,12 @@ public UserInfoResponse userinfo(UserInfoRequest request) throws AuthleteApiExce
* Call {@code /api/auth/userinfo/issue} API.
*/
@Override
- public UserInfoIssueResponse userinfoIssue(UserInfoIssueRequest request) throws AuthleteApiException
+ public UserInfoIssueResponse userinfoIssue(UserInfoIssueRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- UserInfoIssueResponse.class, request, AUTH_USERINFO_ISSUE_API_PATH));
+ UserInfoIssueResponse.class, request, AUTH_USERINFO_ISSUE_API_PATH)
+ .setOptions(options));
}
@@ -662,11 +689,12 @@ public UserInfoIssueResponse userinfoIssue(UserInfoIssueRequest request) throws
* Call {@code /api/auth/introspection} API.
*/
@Override
- public IntrospectionResponse introspection(IntrospectionRequest request) throws AuthleteApiException
+ public IntrospectionResponse introspection(IntrospectionRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- IntrospectionResponse.class, request, AUTH_INTROSPECTION_API_PATH));
+ IntrospectionResponse.class, request, AUTH_INTROSPECTION_API_PATH)
+ .setOptions(options));
}
@@ -675,11 +703,12 @@ public IntrospectionResponse introspection(IntrospectionRequest request) throws
*/
@Override
public StandardIntrospectionResponse standardIntrospection(
- StandardIntrospectionRequest request) throws AuthleteApiException
+ StandardIntrospectionRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- StandardIntrospectionResponse.class, request, AUTH_INTROSPECTION_STANDARD_API_PATH));
+ StandardIntrospectionResponse.class, request, AUTH_INTROSPECTION_STANDARD_API_PATH)
+ .setOptions(options));
}
@@ -687,11 +716,12 @@ public StandardIntrospectionResponse standardIntrospection(
* Call {@code /api/service/create} API.
*/
@Override
- public Service createService(Service service) throws AuthleteApiException
+ public Service createService(Service service, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceOwnerPostApiCaller(
- Service.class, service, SERVICE_CREATE_API_PATH));
+ Service.class, service, SERVICE_CREATE_API_PATH)
+ .setOptions(options));
}
@@ -710,11 +740,12 @@ public Service createServie(Service service) throws AuthleteApiException
* Call /api/service/delete/{serviceApiKey}
API.
*/
@Override
- public void deleteService(long apiKey) throws AuthleteApiException
+ public void deleteService(long apiKey, Options options) throws AuthleteApiException
{
executeApiCall(
new ServiceOwnerDeleteApiCaller(
- SERVICE_DELETE_API_PATH, apiKey));
+ SERVICE_DELETE_API_PATH, apiKey)
+ .setOptions(options));
}
@@ -722,11 +753,12 @@ public void deleteService(long apiKey) throws AuthleteApiException
* Call /api/service/get/{serviceApiKey}
API.
*/
@Override
- public Service getService(long apiKey) throws AuthleteApiException
+ public Service getService(long apiKey, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceOwnerGetApiCaller(
- Service.class, SERVICE_GET_API_PATH, apiKey));
+ Service.class, SERVICE_GET_API_PATH, apiKey)
+ .setOptions(options));
}
@@ -734,28 +766,28 @@ public Service getService(long apiKey) throws AuthleteApiException
* Call {@code /api/service/get/list} API.
*/
@Override
- public ServiceListResponse getServiceList() throws AuthleteApiException
+ public ServiceListResponse getServiceList(Options options) throws AuthleteApiException
{
- return getServiceList(0, 0, false);
+ return getServiceList(0, 0, false, options);
}
@Override
- public ServiceListResponse getServiceList(int start, int end) throws AuthleteApiException
+ public ServiceListResponse getServiceList(int start, int end, Options options) throws AuthleteApiException
{
- return getServiceList(start, end, true);
+ return getServiceList(start, end, true, options);
}
private ServiceListResponse getServiceList(
- final int start, final int end, final boolean rangeGiven) throws AuthleteApiException
+ final int start, final int end, final boolean rangeGiven, Options options) throws AuthleteApiException
{
return executeApiCall(new AuthleteApiCall()
{
@Override
public ServiceListResponse call()
{
- return callGetServiceList(start, end, rangeGiven);
+ return callGetServiceList(start, end, rangeGiven, options);
}
});
}
@@ -764,7 +796,7 @@ public ServiceListResponse call()
/**
* Call /service/get/list
.
*/
- private ServiceListResponse callGetServiceList(int start, int end, boolean rangeGiven)
+ private ServiceListResponse callGetServiceList(int start, int end, boolean rangeGiven, Options options)
{
WebTarget target = getTarget().path(SERVICE_GET_LIST_API_PATH);
@@ -773,10 +805,13 @@ private ServiceListResponse callGetServiceList(int start, int end, boolean range
target = target.queryParam("start", start).queryParam("end", end);
}
- return wrapWithDpop(target
+ Builder builder = wrapWithDpop(target
.request(APPLICATION_JSON_TYPE), SERVICE_GET_LIST_API_PATH, "GET")
- .header(AUTHORIZATION, mServiceOwnerAuth)
- .get(ServiceListResponse.class);
+ .header(AUTHORIZATION, mServiceOwnerAuth);
+
+ setCustomRequestHeaders(builder, options);
+
+ return builder.get(ServiceListResponse.class);
}
@@ -784,11 +819,12 @@ private ServiceListResponse callGetServiceList(int start, int end, boolean range
* Call /api/service/update/{serviceApiKey}
API.
*/
@Override
- public Service updateService(final Service service) throws AuthleteApiException
+ public Service updateService(final Service service, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceOwnerPostApiCaller(
- Service.class, service, SERVICE_UPDATE_API_PATH, service.getApiKey()));
+ Service.class, service, SERVICE_UPDATE_API_PATH, service.getApiKey())
+ .setOptions(options));
}
@@ -796,11 +832,12 @@ public Service updateService(final Service service) throws AuthleteApiException
* Call {@code /api/service/jwks/get} API
*/
@Override
- public String getServiceJwks() throws AuthleteApiException
+ public String getServiceJwks(Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceGetApiCaller(
- String.class, SERVICE_JWKS_GET_API_PATH));
+ String.class, SERVICE_JWKS_GET_API_PATH)
+ .setOptions(options));
}
@@ -808,13 +845,14 @@ public String getServiceJwks() throws AuthleteApiException
* Call {@code /api/service/jwks/get} API
*/
@Override
- public String getServiceJwks(boolean pretty, boolean includePrivateKeys) throws AuthleteApiException
+ public String getServiceJwks(boolean pretty, boolean includePrivateKeys, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceGetApiCaller(
String.class, SERVICE_JWKS_GET_API_PATH)
.addParam("pretty", pretty)
- .addParam("includePrivateKeys", includePrivateKeys));
+ .addParam("includePrivateKeys", includePrivateKeys)
+ .setOptions(options));
}
@@ -822,11 +860,12 @@ public String getServiceJwks(boolean pretty, boolean includePrivateKeys) throws
* Call {@code /api/service/configuration} API
*/
@Override
- public String getServiceConfiguration() throws AuthleteApiException
+ public String getServiceConfiguration(Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceGetApiCaller(
- String.class, SERVICE_CONFIGURATION_API_PATH));
+ String.class, SERVICE_CONFIGURATION_API_PATH)
+ .setOptions(options));
}
@@ -834,12 +873,13 @@ public String getServiceConfiguration() throws AuthleteApiException
* Call {@code /api/service/configuration} API
*/
@Override
- public String getServiceConfiguration(boolean pretty) throws AuthleteApiException
+ public String getServiceConfiguration(boolean pretty, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceGetApiCaller(
String.class, SERVICE_CONFIGURATION_API_PATH)
- .addParam("pretty", pretty));
+ .addParam("pretty", pretty)
+ .setOptions(options));
}
@@ -847,11 +887,12 @@ public String getServiceConfiguration(boolean pretty) throws AuthleteApiExceptio
* Call {@code /api/service/configuration} API
*/
@Override
- public String getServiceConfiguration(ServiceConfigurationRequest request) throws AuthleteApiException
+ public String getServiceConfiguration(ServiceConfigurationRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- String.class, request, SERVICE_CONFIGURATION_API_PATH));
+ String.class, request, SERVICE_CONFIGURATION_API_PATH)
+ .setOptions(options));
}
@@ -859,11 +900,12 @@ public String getServiceConfiguration(ServiceConfigurationRequest request) throw
* Call {@code /api/client/create} API.
*/
@Override
- public Client createClient(Client client) throws AuthleteApiException
+ public Client createClient(Client client, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- Client.class, client, CLIENT_CREATE_API_PATH));
+ Client.class, client, CLIENT_CREATE_API_PATH)
+ .setOptions(options));
}
@@ -871,11 +913,12 @@ public Client createClient(Client client) throws AuthleteApiException
* Call {@code /api/client/registration} API.
*/
@Override
- public ClientRegistrationResponse dynamicClientRegister(ClientRegistrationRequest request) throws AuthleteApiException
+ public ClientRegistrationResponse dynamicClientRegister(ClientRegistrationRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- ClientRegistrationResponse.class, request, CLIENT_REGISTRATION_API_PATH));
+ ClientRegistrationResponse.class, request, CLIENT_REGISTRATION_API_PATH)
+ .setOptions(options));
}
@@ -883,11 +926,12 @@ public ClientRegistrationResponse dynamicClientRegister(ClientRegistrationReques
* Call {@code /api/client/registration/get} API.
*/
@Override
- public ClientRegistrationResponse dynamicClientGet(ClientRegistrationRequest request) throws AuthleteApiException
+ public ClientRegistrationResponse dynamicClientGet(ClientRegistrationRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- ClientRegistrationResponse.class, request, CLIENT_REGISTRATION_GET_API_PATH));
+ ClientRegistrationResponse.class, request, CLIENT_REGISTRATION_GET_API_PATH)
+ .setOptions(options));
}
@@ -895,11 +939,12 @@ public ClientRegistrationResponse dynamicClientGet(ClientRegistrationRequest req
* Call {@code /api/client/registration/update} API.
*/
@Override
- public ClientRegistrationResponse dynamicClientUpdate(ClientRegistrationRequest request) throws AuthleteApiException
+ public ClientRegistrationResponse dynamicClientUpdate(ClientRegistrationRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- ClientRegistrationResponse.class, request, CLIENT_REGISTRATION_UPDATE_API_PATH));
+ ClientRegistrationResponse.class, request, CLIENT_REGISTRATION_UPDATE_API_PATH)
+ .setOptions(options));
}
@@ -907,11 +952,12 @@ public ClientRegistrationResponse dynamicClientUpdate(ClientRegistrationRequest
* Call {@code /api/client/registration/delete} API.
*/
@Override
- public ClientRegistrationResponse dynamicClientDelete(ClientRegistrationRequest request) throws AuthleteApiException
+ public ClientRegistrationResponse dynamicClientDelete(ClientRegistrationRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- ClientRegistrationResponse.class, request, CLIENT_REGISTRATION_DELETE_API_PATH));
+ ClientRegistrationResponse.class, request, CLIENT_REGISTRATION_DELETE_API_PATH)
+ .setOptions(options));
}
@@ -919,9 +965,9 @@ public ClientRegistrationResponse dynamicClientDelete(ClientRegistrationRequest
* Call /api/client/delete/{clientId}
API.
*/
@Override
- public void deleteClient(long clientId) throws AuthleteApiException
+ public void deleteClient(long clientId, Options options) throws AuthleteApiException
{
- deleteClient(String.valueOf(clientId));
+ deleteClient(String.valueOf(clientId), options);
}
@@ -929,11 +975,12 @@ public void deleteClient(long clientId) throws AuthleteApiException
* Call /api/client/delete/{clientId}
API.
*/
@Override
- public void deleteClient(String clientId) throws AuthleteApiException
+ public void deleteClient(String clientId, Options options) throws AuthleteApiException
{
executeApiCall(
new ServiceDeleteApiCaller(
- CLIENT_DELETE_API_PATH, clientId));
+ CLIENT_DELETE_API_PATH, clientId)
+ .setOptions(options));
}
@@ -941,9 +988,9 @@ public void deleteClient(String clientId) throws AuthleteApiException
* Call /api/client/get/{clientId}
API.
*/
@Override
- public Client getClient(long clientId) throws AuthleteApiException
+ public Client getClient(long clientId, Options options) throws AuthleteApiException
{
- return getClient(String.valueOf(clientId));
+ return getClient(String.valueOf(clientId), options);
}
@@ -951,11 +998,12 @@ public Client getClient(long clientId) throws AuthleteApiException
* Call /api/client/get/{clientId}
API.
*/
@Override
- public Client getClient(String clientId) throws AuthleteApiException
+ public Client getClient(String clientId, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceGetApiCaller(
- Client.class, CLIENT_GET_API_PATH, clientId));
+ Client.class, CLIENT_GET_API_PATH, clientId)
+ .setOptions(options));
}
@@ -963,48 +1011,48 @@ public Client getClient(String clientId) throws AuthleteApiException
* Call {@code /api/client/get/list} API.
*/
@Override
- public ClientListResponse getClientList() throws AuthleteApiException
+ public ClientListResponse getClientList(Options options) throws AuthleteApiException
{
- return getClientList(null, 0, 0, false);
+ return getClientList(null, 0, 0, false, options);
}
@Override
- public ClientListResponse getClientList(String developer) throws AuthleteApiException
+ public ClientListResponse getClientList(String developer, Options options) throws AuthleteApiException
{
- return getClientList(developer, 0, 0, false);
+ return getClientList(developer, 0, 0, false, options);
}
@Override
- public ClientListResponse getClientList(int start, int end) throws AuthleteApiException
+ public ClientListResponse getClientList(int start, int end, Options options) throws AuthleteApiException
{
- return getClientList(null, start, end, true);
+ return getClientList(null, start, end, true, options);
}
@Override
- public ClientListResponse getClientList(String developer, int start, int end) throws AuthleteApiException
+ public ClientListResponse getClientList(String developer, int start, int end, Options options) throws AuthleteApiException
{
- return getClientList(developer, start, end, true);
+ return getClientList(developer, start, end, true, options);
}
private ClientListResponse getClientList(
- final String developer, final int start, final int end, final boolean rangeGiven) throws AuthleteApiException
+ final String developer, final int start, final int end, final boolean rangeGiven, Options options) throws AuthleteApiException
{
return executeApiCall(new AuthleteApiCall()
{
@Override
public ClientListResponse call()
{
- return callGetClientList(developer, start, end, rangeGiven);
+ return callGetClientList(developer, start, end, rangeGiven, options);
}
});
}
- private ClientListResponse callGetClientList(String developer, int start, int end, boolean rangeGiven)
+ private ClientListResponse callGetClientList(String developer, int start, int end, boolean rangeGiven, Options options)
{
WebTarget target = getTarget().path(CLIENT_GET_LIST_API_PATH);
@@ -1018,10 +1066,13 @@ private ClientListResponse callGetClientList(String developer, int start, int en
target = target.queryParam("start", start).queryParam("end", end);
}
- return wrapWithDpop(target
+ Builder builder = wrapWithDpop(target
.request(APPLICATION_JSON_TYPE), CLIENT_GET_LIST_API_PATH, "GET")
- .header(AUTHORIZATION, mServiceAuth)
- .get(ClientListResponse.class);
+ .header(AUTHORIZATION, mServiceAuth);
+
+ setCustomRequestHeaders(builder, options);
+
+ return builder.get(ClientListResponse.class);
}
@@ -1029,11 +1080,12 @@ private ClientListResponse callGetClientList(String developer, int start, int en
* Call /api/client/update/{clientId}
API.
*/
@Override
- public Client updateClient(Client client) throws AuthleteApiException
+ public Client updateClient(Client client, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- Client.class, client, CLIENT_UPDATE_API_PATH, client.getClientId()));
+ Client.class, client, CLIENT_UPDATE_API_PATH, client.getClientId())
+ .setOptions(options));
}
@@ -1042,12 +1094,13 @@ public Client updateClient(Client client) throws AuthleteApiException
* Call /api/client/extension/requestable_scopes/get/{clientId}
API.
*/
@Override
- public String[] getRequestableScopes(long clientId) throws AuthleteApiException
+ public String[] getRequestableScopes(long clientId, Options options) throws AuthleteApiException
{
// Call the API.
RequestableScopes response = executeApiCall(
new ServiceGetApiCaller(
- RequestableScopes.class, REQUESTABLE_SCOPES_GET_API_PATH, clientId));
+ RequestableScopes.class, REQUESTABLE_SCOPES_GET_API_PATH, clientId)
+ .setOptions(options));
if (response != null)
{
@@ -1062,7 +1115,7 @@ public String[] getRequestableScopes(long clientId) throws AuthleteApiException
@Override
- public String[] setRequestableScopes(long clientId, String[] scopes) throws AuthleteApiException
+ public String[] setRequestableScopes(long clientId, String[] scopes, Options options) throws AuthleteApiException
{
// Prepare a request body.
RequestableScopes request = new RequestableScopes().setRequestableScopes(scopes);
@@ -1088,16 +1141,17 @@ public String[] setRequestableScopes(long clientId, String[] scopes) throws Auth
* Call /api/client/extension/requestable_scopes/delete/{clientId}
API.
*/
@Override
- public void deleteRequestableScopes(long clientId) throws AuthleteApiException
+ public void deleteRequestableScopes(long clientId, Options options) throws AuthleteApiException
{
executeApiCall(
new ServiceDeleteApiCaller(
- REQUESTABLE_SCOPES_DELETE_API_PATH, clientId));
+ REQUESTABLE_SCOPES_DELETE_API_PATH, clientId)
+ .setOptions(options));
}
@Override
- public GrantedScopesGetResponse getGrantedScopes(long clientId, String subject)
+ public GrantedScopesGetResponse getGrantedScopes(long clientId, String subject, Options options)
{
// Prepare a request body.
GrantedScopesRequest request = new GrantedScopesRequest(subject);
@@ -1105,19 +1159,21 @@ public GrantedScopesGetResponse getGrantedScopes(long clientId, String subject)
// Call the API.
return executeApiCall(
new ServicePostApiCaller(
- GrantedScopesGetResponse.class, request, GRANTED_SCOPES_GET_API_PATH, clientId));
+ GrantedScopesGetResponse.class, request, GRANTED_SCOPES_GET_API_PATH, clientId)
+ .setOptions(options));
}
@Override
- public void deleteGrantedScopes(long clientId, String subject)
+ public void deleteGrantedScopes(long clientId, String subject, Options options)
{
// Prepare a request body.
GrantedScopesRequest request = new GrantedScopesRequest(subject);
executeApiCall(
new ServicePostApiCaller(
- ApiResponse.class, request, GRANTED_SCOPES_DELETE_API_PATH, clientId));
+ ApiResponse.class, request, GRANTED_SCOPES_DELETE_API_PATH, clientId)
+ .setOptions(options));
}
@@ -1148,61 +1204,69 @@ public void setSubject(String subject)
@Override
- public void deleteClientAuthorization(long clientId, String subject) throws AuthleteApiException
+ public void deleteClientAuthorization(long clientId, String subject, Options options) throws AuthleteApiException
{
// Prepare a request body.
ClientAuthorizationDeleteRequest request = new ClientAuthorizationDeleteRequest(subject);
executeApiCall(
new ServicePostApiCaller(
- ApiResponse.class, request, CLIENT_AUTHORIZATION_DELETE_API_PATH, clientId));
+ ApiResponse.class, request, CLIENT_AUTHORIZATION_DELETE_API_PATH, clientId)
+ .setOptions(options));
}
@Override
- public AuthorizedClientListResponse getClientAuthorizationList(ClientAuthorizationGetListRequest request) throws AuthleteApiException
+ public AuthorizedClientListResponse getClientAuthorizationList(
+ ClientAuthorizationGetListRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- AuthorizedClientListResponse.class, request, CLIENT_AUTHORIZATION_GET_LIST_API_PATH));
+ AuthorizedClientListResponse.class, request, CLIENT_AUTHORIZATION_GET_LIST_API_PATH)
+ .setOptions(options));
}
@Override
- public void updateClientAuthorization(long clientId, ClientAuthorizationUpdateRequest request) throws AuthleteApiException
+ public void updateClientAuthorization(
+ long clientId, ClientAuthorizationUpdateRequest request, Options options) throws AuthleteApiException
{
executeApiCall(
new ServicePostApiCaller(
- ApiResponse.class, request, CLIENT_AUTHORIZATION_UPDATE_API_PATH, clientId));
+ ApiResponse.class, request, CLIENT_AUTHORIZATION_UPDATE_API_PATH, clientId)
+ .setOptions(options));
}
@Override
- public ClientSecretRefreshResponse refreshClientSecret(long clientId) throws AuthleteApiException
+ public ClientSecretRefreshResponse refreshClientSecret(long clientId, Options options) throws AuthleteApiException
{
- return refreshClientSecret(String.valueOf(clientId));
+ return refreshClientSecret(String.valueOf(clientId), options);
}
@Override
- public ClientSecretRefreshResponse refreshClientSecret(String clientIdentifier) throws AuthleteApiException
+ public ClientSecretRefreshResponse refreshClientSecret(String clientIdentifier, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceGetApiCaller(
ClientSecretRefreshResponse.class,
- CLIENT_SECRET_REFRESH_API_PATH, clientIdentifier));
+ CLIENT_SECRET_REFRESH_API_PATH, clientIdentifier)
+ .setOptions(options));
}
@Override
- public ClientSecretUpdateResponse updateClientSecret(long clientId, String clientSecret) throws AuthleteApiException
+ public ClientSecretUpdateResponse updateClientSecret(
+ long clientId, String clientSecret, Options options) throws AuthleteApiException
{
- return updateClientSecret(String.valueOf(clientId), clientSecret);
+ return updateClientSecret(String.valueOf(clientId), clientSecret, options);
}
@Override
- public ClientSecretUpdateResponse updateClientSecret(String clientIdentifier, String clientSecret) throws AuthleteApiException
+ public ClientSecretUpdateResponse updateClientSecret(
+ String clientIdentifier, String clientSecret, Options options) throws AuthleteApiException
{
// Prepare a request body. setClientSecret(String) method
// throws IllegalArgumentException if the given client secret
@@ -1213,7 +1277,8 @@ public ClientSecretUpdateResponse updateClientSecret(String clientIdentifier, St
return executeApiCall(
new ServicePostApiCaller(
ClientSecretUpdateResponse.class, request,
- CLIENT_SECRET_UPDATE_API_PATH, clientIdentifier));
+ CLIENT_SECRET_UPDATE_API_PATH, clientIdentifier)
+ .setOptions(options));
}
@@ -1221,11 +1286,12 @@ public ClientSecretUpdateResponse updateClientSecret(String clientIdentifier, St
* Call {@code /api/jose/verify} API.
*/
@Override
- public JoseVerifyResponse verifyJose(JoseVerifyRequest request) throws AuthleteApiException
+ public JoseVerifyResponse verifyJose(JoseVerifyRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- JoseVerifyResponse.class, request, JOSE_VERIFY_API_PATH));
+ JoseVerifyResponse.class, request, JOSE_VERIFY_API_PATH)
+ .setOptions(options));
}
@@ -1233,11 +1299,13 @@ public JoseVerifyResponse verifyJose(JoseVerifyRequest request) throws AuthleteA
* Call {@code /api/backchannel/authentication} API.
*/
@Override
- public BackchannelAuthenticationResponse backchannelAuthentication(BackchannelAuthenticationRequest request) throws AuthleteApiException
+ public BackchannelAuthenticationResponse backchannelAuthentication(
+ BackchannelAuthenticationRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- BackchannelAuthenticationResponse.class, request, BACKCHANNEL_AUTHENTICATION_API_PATH));
+ BackchannelAuthenticationResponse.class, request, BACKCHANNEL_AUTHENTICATION_API_PATH)
+ .setOptions(options));
}
@@ -1245,11 +1313,13 @@ public BackchannelAuthenticationResponse backchannelAuthentication(BackchannelAu
* Call {@code /api/backchannel/authentication/issue} API.
*/
@Override
- public BackchannelAuthenticationIssueResponse backchannelAuthenticationIssue(BackchannelAuthenticationIssueRequest request) throws AuthleteApiException
+ public BackchannelAuthenticationIssueResponse backchannelAuthenticationIssue(
+ BackchannelAuthenticationIssueRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- BackchannelAuthenticationIssueResponse.class, request, BACKCHANNEL_AUTHENTICATION_ISSUE_API_PATH));
+ BackchannelAuthenticationIssueResponse.class, request, BACKCHANNEL_AUTHENTICATION_ISSUE_API_PATH)
+ .setOptions(options));
}
@@ -1257,11 +1327,13 @@ public BackchannelAuthenticationIssueResponse backchannelAuthenticationIssue(Bac
* Call {@code /api/backchannel/authentication/fail} API.
*/
@Override
- public BackchannelAuthenticationFailResponse backchannelAuthenticationFail(BackchannelAuthenticationFailRequest request) throws AuthleteApiException
+ public BackchannelAuthenticationFailResponse backchannelAuthenticationFail(
+ BackchannelAuthenticationFailRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- BackchannelAuthenticationFailResponse.class, request, BACKCHANNEL_AUTHENTICATION_FAIL_API_PATH));
+ BackchannelAuthenticationFailResponse.class, request, BACKCHANNEL_AUTHENTICATION_FAIL_API_PATH)
+ .setOptions(options));
}
@@ -1269,11 +1341,13 @@ public BackchannelAuthenticationFailResponse backchannelAuthenticationFail(Backc
* Call {@code /api/backchannel/authentication/complete} API.
*/
@Override
- public BackchannelAuthenticationCompleteResponse backchannelAuthenticationComplete(BackchannelAuthenticationCompleteRequest request) throws AuthleteApiException
+ public BackchannelAuthenticationCompleteResponse backchannelAuthenticationComplete(
+ BackchannelAuthenticationCompleteRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- BackchannelAuthenticationCompleteResponse.class, request, BACKCHANNEL_AUTHENTICATION_COMPLETE_API_PATH));
+ BackchannelAuthenticationCompleteResponse.class, request, BACKCHANNEL_AUTHENTICATION_COMPLETE_API_PATH)
+ .setOptions(options));
}
@@ -1281,11 +1355,13 @@ public BackchannelAuthenticationCompleteResponse backchannelAuthenticationComple
* Call {@code /api/device/authorization} API.
*/
@Override
- public DeviceAuthorizationResponse deviceAuthorization(DeviceAuthorizationRequest request) throws AuthleteApiException
+ public DeviceAuthorizationResponse deviceAuthorization(
+ DeviceAuthorizationRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- DeviceAuthorizationResponse.class, request, DEVICE_AUTHORIZATION_API_PATH));
+ DeviceAuthorizationResponse.class, request, DEVICE_AUTHORIZATION_API_PATH)
+ .setOptions(options));
}
@@ -1293,11 +1369,13 @@ public DeviceAuthorizationResponse deviceAuthorization(DeviceAuthorizationReques
* Call {@code /api/device/complete} API.
*/
@Override
- public DeviceCompleteResponse deviceComplete(DeviceCompleteRequest request) throws AuthleteApiException
+ public DeviceCompleteResponse deviceComplete(
+ DeviceCompleteRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- DeviceCompleteResponse.class, request, DEVICE_COMPLETE_API_PATH));
+ DeviceCompleteResponse.class, request, DEVICE_COMPLETE_API_PATH)
+ .setOptions(options));
}
@@ -1305,77 +1383,85 @@ public DeviceCompleteResponse deviceComplete(DeviceCompleteRequest request) thro
* Call {@code /api/device/verification} API.
*/
@Override
- public DeviceVerificationResponse deviceVerification(DeviceVerificationRequest request) throws AuthleteApiException
+ public DeviceVerificationResponse deviceVerification(
+ DeviceVerificationRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- DeviceVerificationResponse.class, request, DEVICE_VERIFICATION_API_PATH));
+ DeviceVerificationResponse.class, request, DEVICE_VERIFICATION_API_PATH)
+ .setOptions(options));
}
@Override
- public PushedAuthReqResponse pushAuthorizationRequest(PushedAuthReqRequest request) throws AuthleteApiException
+ public PushedAuthReqResponse pushAuthorizationRequest(
+ PushedAuthReqRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- PushedAuthReqResponse.class, request, PUSHED_AUTH_REQ_API_PATH));
+ PushedAuthReqResponse.class, request, PUSHED_AUTH_REQ_API_PATH)
+ .setOptions(options));
}
@Override
- public HskResponse hskCreate(HskCreateRequest request) throws AuthleteApiException
+ public HskResponse hskCreate(HskCreateRequest request, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServicePostApiCaller(
- HskResponse.class, request, HSK_CREATE_API_PATH));
+ HskResponse.class, request, HSK_CREATE_API_PATH)
+ .setOptions(options));
}
@Override
- public HskResponse hskDelete(String handle) throws AuthleteApiException
+ public HskResponse hskDelete(String handle, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceGetApiCaller(
HskResponse.class,
- HSK_DELETE_API_PATH, handle));
+ HSK_DELETE_API_PATH, handle)
+ .setOptions(options));
}
@Override
- public HskResponse hskGet(String handle) throws AuthleteApiException
+ public HskResponse hskGet(String handle, Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceGetApiCaller(
HskResponse.class,
- HSK_GET_API_PATH, handle));
+ HSK_GET_API_PATH, handle)
+ .setOptions(options));
}
@Override
- public HskListResponse hskGetList() throws AuthleteApiException
+ public HskListResponse hskGetList(Options options) throws AuthleteApiException
{
return executeApiCall(
new ServiceGetApiCaller(
HskListResponse.class,
- HSK_GET_LIST_API_PATH));
+ HSK_GET_LIST_API_PATH)
+ .setOptions(options));
}
@Override
- public Map echo(Map parameters) throws AuthleteApiException
+ public Map echo(Map parameters, Options options) throws AuthleteApiException
{
return executeApiCall(new AuthleteApiCall