From 7be8e6499c912ea8ec7ca59e860b32862bdfc1bb Mon Sep 17 00:00:00 2001 From: Lyle Schemmerling Date: Wed, 17 Sep 2025 16:47:58 -0600 Subject: [PATCH 1/4] new optional tenant id param added (breaking) --- src/main/api/approveDevice.json | 8 ++++++++ src/main/api/clientCredentialsGrant.json | 8 ++++++++ src/main/api/exchangeOAuthCodeForAccessToken.json | 8 ++++++++ .../api/exchangeOAuthCodeForAccessTokenUsingPKCE.json | 8 ++++++++ src/main/api/exchangeRefreshTokenForAccessToken.json | 8 ++++++++ .../api/exchangeUserCredentialsForAccessToken.json | 8 ++++++++ src/main/api/introspectAccessToken.json | 8 ++++++++ .../api/introspectClientCredentialsAccessToken.json | 8 ++++++++ src/main/api/retrieveUserCode.json | 9 +++++++++ src/main/api/retrieveUserCodeUsingAPIKey.json | 9 +++++++++ src/main/api/retrieveUserInfoFromAccessToken.json | 9 +++++++++ src/main/api/validateDevice.json | 9 +++++++++ src/main/client/java.client.ftl | 10 +++++++++- 13 files changed, 109 insertions(+), 1 deletion(-) diff --git a/src/main/api/approveDevice.json b/src/main/api/approveDevice.json index a61f7ed6..315a29a4 100644 --- a/src/main/api/approveDevice.json +++ b/src/main/api/approveDevice.json @@ -41,6 +41,14 @@ "type": "form", "parameterName": "user_code", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request." + ], + "type": "form", + "javaType": "UUID" } ] } diff --git a/src/main/api/clientCredentialsGrant.json b/src/main/api/clientCredentialsGrant.json index ff03213c..b2bc3f9e 100644 --- a/src/main/api/clientCredentialsGrant.json +++ b/src/main/api/clientCredentialsGrant.json @@ -44,6 +44,14 @@ ], "type": "form", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request." + ], + "type": "form", + "javaType": "UUID" } ] } diff --git a/src/main/api/exchangeOAuthCodeForAccessToken.json b/src/main/api/exchangeOAuthCodeForAccessToken.json index 6cb0b2e4..1872e350 100644 --- a/src/main/api/exchangeOAuthCodeForAccessToken.json +++ b/src/main/api/exchangeOAuthCodeForAccessToken.json @@ -52,6 +52,14 @@ ], "type": "form", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request." + ], + "type": "form", + "javaType": "UUID" } ] } diff --git a/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCE.json b/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCE.json index e2eba21f..2497d977 100644 --- a/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCE.json +++ b/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCE.json @@ -60,6 +60,14 @@ ], "type": "form", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request." + ], + "type": "form", + "javaType": "UUID" } ] } diff --git a/src/main/api/exchangeRefreshTokenForAccessToken.json b/src/main/api/exchangeRefreshTokenForAccessToken.json index 94a9cae5..53df703b 100644 --- a/src/main/api/exchangeRefreshTokenForAccessToken.json +++ b/src/main/api/exchangeRefreshTokenForAccessToken.json @@ -60,6 +60,14 @@ ], "type": "form", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request. Required if the request is for a universal application." + ], + "type": "form", + "javaType": "UUID" } ] } diff --git a/src/main/api/exchangeUserCredentialsForAccessToken.json b/src/main/api/exchangeUserCredentialsForAccessToken.json index e629890f..57427d7c 100644 --- a/src/main/api/exchangeUserCredentialsForAccessToken.json +++ b/src/main/api/exchangeUserCredentialsForAccessToken.json @@ -68,6 +68,14 @@ ], "type": "form", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request." + ], + "type": "form", + "javaType": "UUID" } ] } diff --git a/src/main/api/introspectAccessToken.json b/src/main/api/introspectAccessToken.json index eca940df..fea4edec 100644 --- a/src/main/api/introspectAccessToken.json +++ b/src/main/api/introspectAccessToken.json @@ -24,6 +24,14 @@ ], "type": "form", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request." + ], + "type": "form", + "javaType": "UUID" } ] } diff --git a/src/main/api/introspectClientCredentialsAccessToken.json b/src/main/api/introspectClientCredentialsAccessToken.json index 7a538ca5..a303e76f 100644 --- a/src/main/api/introspectClientCredentialsAccessToken.json +++ b/src/main/api/introspectClientCredentialsAccessToken.json @@ -16,6 +16,14 @@ ], "type": "form", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request." + ], + "type": "form", + "javaType": "UUID" } ] } diff --git a/src/main/api/retrieveUserCode.json b/src/main/api/retrieveUserCode.json index 7fdf7e8b..377d89ed 100644 --- a/src/main/api/retrieveUserCode.json +++ b/src/main/api/retrieveUserCode.json @@ -37,6 +37,15 @@ "type": "form", "parameterName": "user_code", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request." + ], + "type": "urlParameter", + "parameterName": "tenantId", + "javaType": "UUID" } ] } diff --git a/src/main/api/retrieveUserCodeUsingAPIKey.json b/src/main/api/retrieveUserCodeUsingAPIKey.json index a55f6bb8..a336f1df 100644 --- a/src/main/api/retrieveUserCodeUsingAPIKey.json +++ b/src/main/api/retrieveUserCodeUsingAPIKey.json @@ -21,6 +21,15 @@ "type": "form", "parameterName": "user_code", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request." + ], + "type": "urlParameter", + "parameterName": "tenantId", + "javaType": "UUID" } ] } diff --git a/src/main/api/retrieveUserInfoFromAccessToken.json b/src/main/api/retrieveUserInfoFromAccessToken.json index 7bccd07a..305dced9 100644 --- a/src/main/api/retrieveUserInfoFromAccessToken.json +++ b/src/main/api/retrieveUserInfoFromAccessToken.json @@ -17,6 +17,15 @@ ], "type": "notUsed", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request." + ], + "type": "urlParameter", + "parameterName": "tenantId", + "javaType": "UUID" } ] } diff --git a/src/main/api/validateDevice.json b/src/main/api/validateDevice.json index f47c7a61..3c25cde0 100644 --- a/src/main/api/validateDevice.json +++ b/src/main/api/validateDevice.json @@ -27,6 +27,15 @@ "type": "urlParameter", "parameterName": "client_id", "javaType": "String" + }, + { + "name": "tenantId", + "comments": [ + "(Optional) The Id of the tenant to use for this request." + ], + "type": "urlParameter", + "parameterName": "tenantId", + "javaType": "UUID" } ] } diff --git a/src/main/client/java.client.ftl b/src/main/client/java.client.ftl index be87944c..f04382c4 100644 --- a/src/main/client/java.client.ftl +++ b/src/main/client/java.client.ftl @@ -363,8 +363,16 @@ public class FusionAuthClient { [#if formPost] Map> parameters = new HashMap<>(); [#list api.params![] as param] + [#assign pval = param.name /] [#if param.type == "form"] - parameters.put("${param.name}", Arrays.asList(${(param.constant?? && param.constant)?then("\""+param.value+"\"", param.name)})); + [#if param.constant?? && param.constant] + [#assign pval = "\""+param.value+"\"" /] + [#else] + [#if param.javaType != "String"] + [#assign pval = "\"\" + ${param.name}" /] + [/#if] + [/#if] + parameters.put("${param.name}", Arrays.asList(${pval})); [/#if] [/#list] [/#if] From 68acca6ce3b39f6b117e09b64fae9f8c9b0abf2d Mon Sep 17 00:00:00 2001 From: Lyle Schemmerling Date: Tue, 23 Sep 2025 12:17:30 -0600 Subject: [PATCH 2/4] validate and libs --- src/main/api/approveDevice.json | 8 ---- src/main/api/approveDeviceUsingRequest.json | 20 ++++++++++ src/main/api/clientCredentialsGrant.json | 8 ---- .../clientCredentialsGrantUsingRequest.json | 21 +++++++++++ src/main/api/deviceAuthorize.json | 37 +++++++++++++++++++ src/main/api/deviceAuthorizeUsingRequest.json | 21 +++++++++++ .../api/exchangeOAuthCodeForAccessToken.json | 8 ---- ...hangeOAuthCodeForAccessTokenUsingPKCE.json | 8 ---- ...deForAccessTokenUsingPKCEUsingRequest.json | 22 +++++++++++ ...geOAuthCodeForAccessTokenUsingRequest.json | 22 +++++++++++ .../exchangeRefreshTokenForAccessToken.json | 8 ---- ...efreshTokenForAccessTokenUsingRequest.json | 22 +++++++++++ ...exchangeUserCredentialsForAccessToken.json | 8 ---- ...CredentialsForAccessTokenUsingRequest.json | 22 +++++++++++ src/main/api/introspectAccessToken.json | 8 ---- .../introspectAccessTokenUsingRequest.json | 21 +++++++++++ ...ntrospectClientCredentialsAccessToken.json | 8 ---- ...entCredentialsAccessTokenUsingRequest.json | 21 +++++++++++ src/main/api/retrieveUserCode.json | 9 ----- src/main/api/retrieveUserCodeUsingAPIKey.json | 9 ----- ...trieveUserCodeUsingAPIKeyUsingRequest.json | 25 +++++++++++++ .../api/retrieveUserCodeUsingRequest.json | 23 ++++++++++++ src/main/api/validateDevice.json | 9 ----- src/main/api/validateDeviceUsingRequest.json | 22 +++++++++++ src/main/client/java.client.ftl | 11 ++++++ 25 files changed, 310 insertions(+), 91 deletions(-) create mode 100644 src/main/api/approveDeviceUsingRequest.json create mode 100644 src/main/api/clientCredentialsGrantUsingRequest.json create mode 100644 src/main/api/deviceAuthorize.json create mode 100644 src/main/api/deviceAuthorizeUsingRequest.json create mode 100644 src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCEUsingRequest.json create mode 100644 src/main/api/exchangeOAuthCodeForAccessTokenUsingRequest.json create mode 100644 src/main/api/exchangeRefreshTokenForAccessTokenUsingRequest.json create mode 100644 src/main/api/exchangeUserCredentialsForAccessTokenUsingRequest.json create mode 100644 src/main/api/introspectAccessTokenUsingRequest.json create mode 100644 src/main/api/introspectClientCredentialsAccessTokenUsingRequest.json create mode 100644 src/main/api/retrieveUserCodeUsingAPIKeyUsingRequest.json create mode 100644 src/main/api/retrieveUserCodeUsingRequest.json create mode 100644 src/main/api/validateDeviceUsingRequest.json diff --git a/src/main/api/approveDevice.json b/src/main/api/approveDevice.json index 315a29a4..a61f7ed6 100644 --- a/src/main/api/approveDevice.json +++ b/src/main/api/approveDevice.json @@ -41,14 +41,6 @@ "type": "form", "parameterName": "user_code", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request." - ], - "type": "form", - "javaType": "UUID" } ] } diff --git a/src/main/api/approveDeviceUsingRequest.json b/src/main/api/approveDeviceUsingRequest.json new file mode 100644 index 00000000..14e47ff6 --- /dev/null +++ b/src/main/api/approveDeviceUsingRequest.json @@ -0,0 +1,20 @@ +{ + "uri": "/oauth2/device/approve", + "comments": [ + "Approve a device grant." + ], + "method": "post", + "methodName": "approveDeviceWithRequest", + "successResponse": "DeviceApprovalResponse", + "errorResponse": "Errors", + "params": [ + { + "name": "request", + "comments": [ + "The request object containing the device approval information and optional tenantId." + ], + "type": "body", + "javaType": "DeviceApprovalRequest" + } + ] +} diff --git a/src/main/api/clientCredentialsGrant.json b/src/main/api/clientCredentialsGrant.json index b2bc3f9e..ff03213c 100644 --- a/src/main/api/clientCredentialsGrant.json +++ b/src/main/api/clientCredentialsGrant.json @@ -44,14 +44,6 @@ ], "type": "form", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request." - ], - "type": "form", - "javaType": "UUID" } ] } diff --git a/src/main/api/clientCredentialsGrantUsingRequest.json b/src/main/api/clientCredentialsGrantUsingRequest.json new file mode 100644 index 00000000..66cda12b --- /dev/null +++ b/src/main/api/clientCredentialsGrantUsingRequest.json @@ -0,0 +1,21 @@ +{ + "uri": "/oauth2/token", + "comments": [ + "Make a Client Credentials grant request to obtain an access token." + ], + "method": "post", + "methodName": "clientCredentialsGrantWithRequest", + "successResponse": "AccessToken", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The client credentials grant request containing client authentication, scope and optional tenantId." + ], + "type": "body", + "javaType": "ClientCredentialsGrantRequest" + } + ] +} diff --git a/src/main/api/deviceAuthorize.json b/src/main/api/deviceAuthorize.json new file mode 100644 index 00000000..a3c63dbd --- /dev/null +++ b/src/main/api/deviceAuthorize.json @@ -0,0 +1,37 @@ +{ + "uri": "/oauth2/device_authorize", + "comments": [ + "Start the Device Authorization flow using form-encoded parameters" + ], + "method": "post", + "methodName": "deviceAuthorize", + "successResponse": "DeviceResponse", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "client_id", + "comments": [ + "The unique client identifier. The client Id is the Id of the FusionAuth Application in which you are attempting to authenticate." + ], + "type": "form", + "javaType": "String" + }, + { + "name": "client_secret", + "comments": [ + "(Optional) The client secret. This value may optionally be provided in the request body instead of the Authorization header." + ], + "type": "form", + "javaType": "String" + }, + { + "name": "scope", + "comments": [ + "(Optional) A space-delimited string of the requested scopes. Defaults to all scopes configured in the Application's OAuth configuration." + ], + "type": "form", + "javaType": "String" + } + ] +} diff --git a/src/main/api/deviceAuthorizeUsingRequest.json b/src/main/api/deviceAuthorizeUsingRequest.json new file mode 100644 index 00000000..ce22219b --- /dev/null +++ b/src/main/api/deviceAuthorizeUsingRequest.json @@ -0,0 +1,21 @@ +{ + "uri": "/oauth2/device_authorize", + "comments": [ + "Start the Device Authorization flow using a request body" + ], + "method": "post", + "methodName": "deviceAuthorizeWithRequest", + "successResponse": "DeviceResponse", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The device authorization request containing client authentication, scope, and optional device metadata." + ], + "type": "body", + "javaType": "DeviceAuthorizationRequest" + } + ] +} \ No newline at end of file diff --git a/src/main/api/exchangeOAuthCodeForAccessToken.json b/src/main/api/exchangeOAuthCodeForAccessToken.json index 1872e350..6cb0b2e4 100644 --- a/src/main/api/exchangeOAuthCodeForAccessToken.json +++ b/src/main/api/exchangeOAuthCodeForAccessToken.json @@ -52,14 +52,6 @@ ], "type": "form", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request." - ], - "type": "form", - "javaType": "UUID" } ] } diff --git a/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCE.json b/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCE.json index 2497d977..e2eba21f 100644 --- a/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCE.json +++ b/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCE.json @@ -60,14 +60,6 @@ ], "type": "form", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request." - ], - "type": "form", - "javaType": "UUID" } ] } diff --git a/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCEUsingRequest.json b/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCEUsingRequest.json new file mode 100644 index 00000000..2d0bfe3e --- /dev/null +++ b/src/main/api/exchangeOAuthCodeForAccessTokenUsingPKCEUsingRequest.json @@ -0,0 +1,22 @@ +{ + "uri": "/oauth2/token", + "comments": [ + "Exchanges an OAuth authorization code and code_verifier for an access token.", + "Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint and a code_verifier for an access token." + ], + "method": "post", + "methodName": "exchangeOAuthCodeForAccessTokenUsingPKCEWithRequest", + "successResponse": "AccessToken", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The PKCE OAuth code access token exchange request." + ], + "type": "body", + "javaType": "OAuthCodePKCEAccessTokenRequest" + } + ] +} diff --git a/src/main/api/exchangeOAuthCodeForAccessTokenUsingRequest.json b/src/main/api/exchangeOAuthCodeForAccessTokenUsingRequest.json new file mode 100644 index 00000000..50f13360 --- /dev/null +++ b/src/main/api/exchangeOAuthCodeForAccessTokenUsingRequest.json @@ -0,0 +1,22 @@ +{ + "uri": "/oauth2/token", + "comments": [ + "Exchanges an OAuth authorization code for an access token.", + "Makes a request to the Token endpoint to exchange the authorization code returned from the Authorize endpoint for an access token." + ], + "method": "post", + "methodName": "exchangeOAuthCodeForAccessTokenWithRequest", + "successResponse": "AccessToken", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The OAuth code access token exchange request." + ], + "type": "body", + "javaType": "OAuthCodeAccessTokenRequest" + } + ] +} diff --git a/src/main/api/exchangeRefreshTokenForAccessToken.json b/src/main/api/exchangeRefreshTokenForAccessToken.json index 53df703b..94a9cae5 100644 --- a/src/main/api/exchangeRefreshTokenForAccessToken.json +++ b/src/main/api/exchangeRefreshTokenForAccessToken.json @@ -60,14 +60,6 @@ ], "type": "form", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request. Required if the request is for a universal application." - ], - "type": "form", - "javaType": "UUID" } ] } diff --git a/src/main/api/exchangeRefreshTokenForAccessTokenUsingRequest.json b/src/main/api/exchangeRefreshTokenForAccessTokenUsingRequest.json new file mode 100644 index 00000000..840373bc --- /dev/null +++ b/src/main/api/exchangeRefreshTokenForAccessTokenUsingRequest.json @@ -0,0 +1,22 @@ +{ + "uri": "/oauth2/token", + "comments": [ + "Exchange a Refresh Token for an Access Token.", + "If you will be using the Refresh Token Grant, you will make a request to the Token endpoint to exchange the user’s refresh token for an access token." + ], + "method": "post", + "methodName": "exchangeRefreshTokenForAccessTokenWithRequest", + "successResponse": "AccessToken", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The refresh token access token exchange request." + ], + "type": "body", + "javaType": "RefreshTokenAccessTokenRequest" + } + ] +} diff --git a/src/main/api/exchangeUserCredentialsForAccessToken.json b/src/main/api/exchangeUserCredentialsForAccessToken.json index 57427d7c..e629890f 100644 --- a/src/main/api/exchangeUserCredentialsForAccessToken.json +++ b/src/main/api/exchangeUserCredentialsForAccessToken.json @@ -68,14 +68,6 @@ ], "type": "form", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request." - ], - "type": "form", - "javaType": "UUID" } ] } diff --git a/src/main/api/exchangeUserCredentialsForAccessTokenUsingRequest.json b/src/main/api/exchangeUserCredentialsForAccessTokenUsingRequest.json new file mode 100644 index 00000000..d5781b58 --- /dev/null +++ b/src/main/api/exchangeUserCredentialsForAccessTokenUsingRequest.json @@ -0,0 +1,22 @@ +{ + "uri": "/oauth2/token", + "comments": [ + "Exchange User Credentials for a Token.", + "If you will be using the Resource Owner Password Credential Grant, you will make a request to the Token endpoint to exchange the user’s email and password for an access token." + ], + "method": "post", + "methodName": "exchangeUserCredentialsForAccessTokenWithRequest", + "successResponse": "AccessToken", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The user credentials access token exchange request." + ], + "type": "body", + "javaType": "UserCredentialsAccessTokenRequest" + } + ] +} diff --git a/src/main/api/introspectAccessToken.json b/src/main/api/introspectAccessToken.json index fea4edec..eca940df 100644 --- a/src/main/api/introspectAccessToken.json +++ b/src/main/api/introspectAccessToken.json @@ -24,14 +24,6 @@ ], "type": "form", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request." - ], - "type": "form", - "javaType": "UUID" } ] } diff --git a/src/main/api/introspectAccessTokenUsingRequest.json b/src/main/api/introspectAccessTokenUsingRequest.json new file mode 100644 index 00000000..31ab5839 --- /dev/null +++ b/src/main/api/introspectAccessTokenUsingRequest.json @@ -0,0 +1,21 @@ +{ + "uri": "/oauth2/introspect", + "comments": [ + "Inspect an access token issued as the result of the User based grant such as the Authorization Code Grant, Implicit Grant, the User Credentials Grant or the Refresh Grant." + ], + "method": "post", + "methodName": "introspectAccessTokenWithRequest", + "successResponse": "IntrospectResponse", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The access token introspection request." + ], + "type": "body", + "javaType": "AccessTokenIntrospectRequest" + } + ] +} diff --git a/src/main/api/introspectClientCredentialsAccessToken.json b/src/main/api/introspectClientCredentialsAccessToken.json index a303e76f..7a538ca5 100644 --- a/src/main/api/introspectClientCredentialsAccessToken.json +++ b/src/main/api/introspectClientCredentialsAccessToken.json @@ -16,14 +16,6 @@ ], "type": "form", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request." - ], - "type": "form", - "javaType": "UUID" } ] } diff --git a/src/main/api/introspectClientCredentialsAccessTokenUsingRequest.json b/src/main/api/introspectClientCredentialsAccessTokenUsingRequest.json new file mode 100644 index 00000000..09394401 --- /dev/null +++ b/src/main/api/introspectClientCredentialsAccessTokenUsingRequest.json @@ -0,0 +1,21 @@ +{ + "uri": "/oauth2/introspect", + "comments": [ + "Inspect an access token issued as the result of the Client Credentials Grant." + ], + "method": "post", + "methodName": "introspectClientCredentialsAccessTokenWithRequest", + "successResponse": "IntrospectResponse", + "errorResponse": "OAuthError", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The client credentials access token." + ], + "type": "body", + "javaType": "ClientCredentialsAccessTokenIntrospectRequest" + } + ] +} diff --git a/src/main/api/retrieveUserCode.json b/src/main/api/retrieveUserCode.json index 377d89ed..7fdf7e8b 100644 --- a/src/main/api/retrieveUserCode.json +++ b/src/main/api/retrieveUserCode.json @@ -37,15 +37,6 @@ "type": "form", "parameterName": "user_code", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request." - ], - "type": "urlParameter", - "parameterName": "tenantId", - "javaType": "UUID" } ] } diff --git a/src/main/api/retrieveUserCodeUsingAPIKey.json b/src/main/api/retrieveUserCodeUsingAPIKey.json index a336f1df..a55f6bb8 100644 --- a/src/main/api/retrieveUserCodeUsingAPIKey.json +++ b/src/main/api/retrieveUserCodeUsingAPIKey.json @@ -21,15 +21,6 @@ "type": "form", "parameterName": "user_code", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request." - ], - "type": "urlParameter", - "parameterName": "tenantId", - "javaType": "UUID" } ] } diff --git a/src/main/api/retrieveUserCodeUsingAPIKeyUsingRequest.json b/src/main/api/retrieveUserCodeUsingAPIKeyUsingRequest.json new file mode 100644 index 00000000..0c5cb727 --- /dev/null +++ b/src/main/api/retrieveUserCodeUsingAPIKeyUsingRequest.json @@ -0,0 +1,25 @@ +{ + "uri": "/oauth2/device/user-code", + "comments": [ + "Retrieve a user_code that is part of an in-progress Device Authorization Grant.", + "", + "This API is useful if you want to build your own login workflow to complete a device grant.", + "", + "This request will require an API key." + ], + "method": "post", + "methodName": "retrieveUserCodeUsingAPIKeyWithRequest", + "successResponse": "Void", + "errorResponse": "Void", + "anonymous": false, + "params": [ + { + "name": "request", + "comments": [ + "The user code retrieval request including optional tenantId." + ], + "type": "body", + "javaType": "RetrieveUserCodeUsingAPIKeyRequest" + } + ] +} diff --git a/src/main/api/retrieveUserCodeUsingRequest.json b/src/main/api/retrieveUserCodeUsingRequest.json new file mode 100644 index 00000000..20d6dd57 --- /dev/null +++ b/src/main/api/retrieveUserCodeUsingRequest.json @@ -0,0 +1,23 @@ +{ + "uri": "/oauth2/device/user-code", + "comments": [ + "Retrieve a user_code that is part of an in-progress Device Authorization Grant.", + "", + "This API is useful if you want to build your own login workflow to complete a device grant." + ], + "method": "post", + "methodName": "retrieveUserCodeWithRequest", + "successResponse": "Void", + "errorResponse": "Void", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The user code retrieval request." + ], + "type": "body", + "javaType": "RetrieveUserCodeRequest" + } + ] +} diff --git a/src/main/api/validateDevice.json b/src/main/api/validateDevice.json index 3c25cde0..f47c7a61 100644 --- a/src/main/api/validateDevice.json +++ b/src/main/api/validateDevice.json @@ -27,15 +27,6 @@ "type": "urlParameter", "parameterName": "client_id", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request." - ], - "type": "urlParameter", - "parameterName": "tenantId", - "javaType": "UUID" } ] } diff --git a/src/main/api/validateDeviceUsingRequest.json b/src/main/api/validateDeviceUsingRequest.json new file mode 100644 index 00000000..a984b528 --- /dev/null +++ b/src/main/api/validateDeviceUsingRequest.json @@ -0,0 +1,22 @@ +{ + "uri": "/oauth2/device/validate", + "comments": [ + "Validates the end-user provided user_code from the user-interaction of the Device Authorization Grant.", + "If you build your own activation form you should validate the user provided code prior to beginning the Authorization grant." + ], + "method": "post", + "methodName": "validateDeviceWithRequest", + "successResponse": "Void", + "errorResponse": "Void", + "anonymous": true, + "params": [ + { + "name": "request", + "comments": [ + "The device validation request." + ], + "type": "body", + "javaType": "ValidateDeviceRequest" + } + ] +} diff --git a/src/main/client/java.client.ftl b/src/main/client/java.client.ftl index f04382c4..34ba99f0 100644 --- a/src/main/client/java.client.ftl +++ b/src/main/client/java.client.ftl @@ -238,11 +238,22 @@ import io.fusionauth.domain.api.user.VerifyEmailResponse; import io.fusionauth.domain.api.user.VerifyRegistrationRequest; import io.fusionauth.domain.api.user.VerifyRegistrationResponse; import io.fusionauth.domain.oauth2.AccessToken; +import io.fusionauth.domain.oauth2.AccessTokenIntrospectRequest; +import io.fusionauth.domain.oauth2.ClientCredentialsAccessTokenIntrospectRequest; +import io.fusionauth.domain.oauth2.ClientCredentialsGrantRequest; +import io.fusionauth.domain.oauth2.DeviceApprovalRequest; import io.fusionauth.domain.oauth2.DeviceApprovalResponse; import io.fusionauth.domain.oauth2.IntrospectResponse; import io.fusionauth.domain.oauth2.JWKSResponse; +import io.fusionauth.domain.oauth2.OAuthCodeAccessTokenRequest; +import io.fusionauth.domain.oauth2.OAuthCodePKCEAccessTokenRequest; import io.fusionauth.domain.oauth2.OAuthError; +import io.fusionauth.domain.oauth2.RefreshTokenAccessTokenRequest; +import io.fusionauth.domain.oauth2.RetrieveUserCodeRequest; +import io.fusionauth.domain.oauth2.RetrieveUserCodeUsingAPIKeyRequest; +import io.fusionauth.domain.oauth2.UserCredentialsAccessTokenRequest; import io.fusionauth.domain.oauth2.UserinfoResponse; +import io.fusionauth.domain.oauth2.ValidateDeviceRequest; import io.fusionauth.domain.provider.IdentityProviderType; /** From 7640aac0d011286496f860e6ebf5273f7c69c569 Mon Sep 17 00:00:00 2001 From: Lyle Schemmerling Date: Tue, 23 Sep 2025 12:42:53 -0600 Subject: [PATCH 3/4] fix imports and user info --- src/main/api/retrieveUserInfoFromAccessToken.json | 9 --------- src/main/client/java.client.ftl | 2 ++ 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/main/api/retrieveUserInfoFromAccessToken.json b/src/main/api/retrieveUserInfoFromAccessToken.json index 305dced9..7bccd07a 100644 --- a/src/main/api/retrieveUserInfoFromAccessToken.json +++ b/src/main/api/retrieveUserInfoFromAccessToken.json @@ -17,15 +17,6 @@ ], "type": "notUsed", "javaType": "String" - }, - { - "name": "tenantId", - "comments": [ - "(Optional) The Id of the tenant to use for this request." - ], - "type": "urlParameter", - "parameterName": "tenantId", - "javaType": "UUID" } ] } diff --git a/src/main/client/java.client.ftl b/src/main/client/java.client.ftl index 34ba99f0..aae63ec0 100644 --- a/src/main/client/java.client.ftl +++ b/src/main/client/java.client.ftl @@ -243,6 +243,8 @@ import io.fusionauth.domain.oauth2.ClientCredentialsAccessTokenIntrospectRequest import io.fusionauth.domain.oauth2.ClientCredentialsGrantRequest; import io.fusionauth.domain.oauth2.DeviceApprovalRequest; import io.fusionauth.domain.oauth2.DeviceApprovalResponse; +import io.fusionauth.domain.oauth2.DeviceAuthorizationRequest; +import io.fusionauth.domain.oauth2.DeviceResponse; import io.fusionauth.domain.oauth2.IntrospectResponse; import io.fusionauth.domain.oauth2.JWKSResponse; import io.fusionauth.domain.oauth2.OAuthCodeAccessTokenRequest; From a28748d0fba9695d40b0c8ae6a2fd9fd2ec625a8 Mon Sep 17 00:00:00 2001 From: Lyle Schemmerling Date: Tue, 23 Sep 2025 13:07:58 -0600 Subject: [PATCH 4/4] remove incompatible go methods --- src/main/client/go.client.ftl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/client/go.client.ftl b/src/main/client/go.client.ftl index 1ce43cd5..4761fbfe 100644 --- a/src/main/client/go.client.ftl +++ b/src/main/client/go.client.ftl @@ -184,7 +184,7 @@ func (rc *restClient) WithUriSegment(segment string) *restClient { [#-- @formatter:off --] [#-- Ignoring these few following APIs due to currently being unable to convert the json response into the actual IdentityProvider type. Need a conversion utility. --] -[#assign ignoredAPIs = ["CreateIdentityProvider","IntrospectAccessToken","IntrospectClientCredentialsAccessToken","RetrieveIdentityProvider","RetrieveIdentityProviders","RetrieveUserInfoFromAccessToken","UpdateIdentityProvider"]/] +[#assign ignoredAPIs = ["CreateIdentityProvider","IntrospectAccessToken","IntrospectAccessTokenWithRequest","IntrospectClientCredentialsAccessToken","IntrospectClientCredentialsAccessTokenWithRequest","RetrieveIdentityProvider","RetrieveIdentityProviders","RetrieveUserInfoFromAccessToken","UpdateIdentityProvider"]/] [#list apis as api] [#if !(ignoredAPIs?seq_contains(api.methodName?cap_first))] // ${api.methodName?cap_first}