diff --git a/src/main/java/io/supertokens/oauth/HttpRequest.java b/src/main/java/io/supertokens/oauth/HttpRequestForOry.java similarity index 94% rename from src/main/java/io/supertokens/oauth/HttpRequest.java rename to src/main/java/io/supertokens/oauth/HttpRequestForOry.java index ff3b954d7..62f5945e8 100644 --- a/src/main/java/io/supertokens/oauth/HttpRequest.java +++ b/src/main/java/io/supertokens/oauth/HttpRequestForOry.java @@ -15,7 +15,13 @@ import java.util.Map; import java.util.stream.Collectors; -public class HttpRequest { +public class HttpRequestForOry { + // This is a helper class to make HTTP requests to the hydra server specifically. + // Although this is similar to HttpRequest, this is slightly modified to be able to work with + // form data, headers in request and responses, query params in non-get requests, reading responses in + // case of errors, etc. + // Left the original HttpRequest as is to avoid any issues with existing code. + private static final int CONNECTION_TIMEOUT = 5000; private static final int READ_TIMEOUT = 5000; diff --git a/src/main/java/io/supertokens/oauth/OAuth.java b/src/main/java/io/supertokens/oauth/OAuth.java index 36968478f..7e60dcc70 100644 --- a/src/main/java/io/supertokens/oauth/OAuth.java +++ b/src/main/java/io/supertokens/oauth/OAuth.java @@ -63,7 +63,7 @@ private static void checkForOauthFeature(AppIdentifier appIdentifier, Main main) "feature."); } - public static HttpRequest.Response doOAuthProxyGET(Main main, AppIdentifier appIdentifier, Storage storage, String path, boolean proxyToAdmin, boolean camelToSnakeCaseConversion, Map queryParams, Map headers) throws StorageQueryException, OAuthClientNotFoundException, TenantOrAppNotFoundException, FeatureNotEnabledException, InvalidConfigException, IOException, OAuthAPIException { + public static HttpRequestForOry.Response doOAuthProxyGET(Main main, AppIdentifier appIdentifier, Storage storage, String path, boolean proxyToAdmin, boolean camelToSnakeCaseConversion, Map queryParams, Map headers) throws StorageQueryException, OAuthClientNotFoundException, TenantOrAppNotFoundException, FeatureNotEnabledException, InvalidConfigException, IOException, OAuthAPIException { checkForOauthFeature(appIdentifier, main); OAuthStorage oauthStorage = StorageUtils.getOAuthStorage(storage); @@ -90,7 +90,7 @@ public static HttpRequest.Response doOAuthProxyGET(Main main, AppIdentifier appI } String fullUrl = baseURL + path; - HttpRequest.Response response = HttpRequest.doGet(fullUrl, headers, queryParams); + HttpRequestForOry.Response response = HttpRequestForOry.doGet(fullUrl, headers, queryParams); // Response transformations response.jsonResponse = Transformations.transformJsonResponseFromHydra(main, appIdentifier, response.jsonResponse); @@ -106,7 +106,7 @@ public static HttpRequest.Response doOAuthProxyGET(Main main, AppIdentifier appI return response; } - public static HttpRequest.Response doOAuthProxyFormPOST(Main main, AppIdentifier appIdentifier, Storage storage, String path, boolean proxyToAdmin, boolean camelToSnakeCaseConversion, Map formFields, Map headers) throws StorageQueryException, OAuthClientNotFoundException, TenantOrAppNotFoundException, FeatureNotEnabledException, InvalidConfigException, IOException, OAuthAPIException { + public static HttpRequestForOry.Response doOAuthProxyFormPOST(Main main, AppIdentifier appIdentifier, Storage storage, String path, boolean proxyToAdmin, boolean camelToSnakeCaseConversion, Map formFields, Map headers) throws StorageQueryException, OAuthClientNotFoundException, TenantOrAppNotFoundException, FeatureNotEnabledException, InvalidConfigException, IOException, OAuthAPIException { checkForOauthFeature(appIdentifier, main); OAuthStorage oauthStorage = StorageUtils.getOAuthStorage(storage); @@ -133,7 +133,7 @@ public static HttpRequest.Response doOAuthProxyFormPOST(Main main, AppIdentifier } String fullUrl = baseURL + path; - HttpRequest.Response response = HttpRequest.doFormPost(fullUrl, headers, formFields); + HttpRequestForOry.Response response = HttpRequestForOry.doFormPost(fullUrl, headers, formFields); // Response transformations response.jsonResponse = Transformations.transformJsonResponseFromHydra(main, appIdentifier, response.jsonResponse); @@ -148,7 +148,7 @@ public static HttpRequest.Response doOAuthProxyFormPOST(Main main, AppIdentifier return response; } - public static HttpRequest.Response doOAuthProxyJsonPOST(Main main, AppIdentifier appIdentifier, Storage storage, String path, boolean proxyToAdmin, boolean camelToSnakeCaseConversion, JsonObject jsonInput, Map headers) throws StorageQueryException, OAuthClientNotFoundException, TenantOrAppNotFoundException, FeatureNotEnabledException, InvalidConfigException, IOException, OAuthAPIException { + public static HttpRequestForOry.Response doOAuthProxyJsonPOST(Main main, AppIdentifier appIdentifier, Storage storage, String path, boolean proxyToAdmin, boolean camelToSnakeCaseConversion, JsonObject jsonInput, Map headers) throws StorageQueryException, OAuthClientNotFoundException, TenantOrAppNotFoundException, FeatureNotEnabledException, InvalidConfigException, IOException, OAuthAPIException { checkForOauthFeature(appIdentifier, main); OAuthStorage oauthStorage = StorageUtils.getOAuthStorage(storage); @@ -175,7 +175,7 @@ public static HttpRequest.Response doOAuthProxyJsonPOST(Main main, AppIdentifier } String fullUrl = baseURL + path; - HttpRequest.Response response = HttpRequest.doJsonPost(fullUrl, headers, jsonInput); + HttpRequestForOry.Response response = HttpRequestForOry.doJsonPost(fullUrl, headers, jsonInput); // Response transformations response.jsonResponse = Transformations.transformJsonResponseFromHydra(main, appIdentifier, response.jsonResponse); @@ -190,7 +190,7 @@ public static HttpRequest.Response doOAuthProxyJsonPOST(Main main, AppIdentifier return response; } - public static HttpRequest.Response doOAuthProxyJsonPUT(Main main, AppIdentifier appIdentifier, Storage storage, String path, boolean proxyToAdmin, boolean camelToSnakeCaseConversion, Map queryParams, JsonObject jsonInput, Map headers) throws StorageQueryException, OAuthClientNotFoundException, TenantOrAppNotFoundException, FeatureNotEnabledException, InvalidConfigException, IOException, OAuthAPIException { + public static HttpRequestForOry.Response doOAuthProxyJsonPUT(Main main, AppIdentifier appIdentifier, Storage storage, String path, boolean proxyToAdmin, boolean camelToSnakeCaseConversion, Map queryParams, JsonObject jsonInput, Map headers) throws StorageQueryException, OAuthClientNotFoundException, TenantOrAppNotFoundException, FeatureNotEnabledException, InvalidConfigException, IOException, OAuthAPIException { checkForOauthFeature(appIdentifier, main); OAuthStorage oauthStorage = StorageUtils.getOAuthStorage(storage); @@ -218,7 +218,7 @@ public static HttpRequest.Response doOAuthProxyJsonPUT(Main main, AppIdentifier } String fullUrl = baseURL + path; - HttpRequest.Response response = HttpRequest.doJsonPut(fullUrl, queryParams, headers, jsonInput); + HttpRequestForOry.Response response = HttpRequestForOry.doJsonPut(fullUrl, queryParams, headers, jsonInput); // Response transformations response.jsonResponse = Transformations.transformJsonResponseFromHydra(main, appIdentifier, response.jsonResponse); @@ -233,7 +233,7 @@ public static HttpRequest.Response doOAuthProxyJsonPUT(Main main, AppIdentifier return response; } - public static HttpRequest.Response doOAuthProxyJsonDELETE(Main main, AppIdentifier appIdentifier, Storage storage, String path, boolean proxyToAdmin, boolean camelToSnakeCaseConversion, JsonObject jsonInput, Map headers) throws StorageQueryException, OAuthClientNotFoundException, TenantOrAppNotFoundException, FeatureNotEnabledException, InvalidConfigException, IOException, OAuthAPIException { + public static HttpRequestForOry.Response doOAuthProxyJsonDELETE(Main main, AppIdentifier appIdentifier, Storage storage, String path, boolean proxyToAdmin, boolean camelToSnakeCaseConversion, JsonObject jsonInput, Map headers) throws StorageQueryException, OAuthClientNotFoundException, TenantOrAppNotFoundException, FeatureNotEnabledException, InvalidConfigException, IOException, OAuthAPIException { checkForOauthFeature(appIdentifier, main); OAuthStorage oauthStorage = StorageUtils.getOAuthStorage(storage); @@ -260,7 +260,7 @@ public static HttpRequest.Response doOAuthProxyJsonDELETE(Main main, AppIdentifi } String fullUrl = baseURL + path; - HttpRequest.Response response = HttpRequest.doJsonDelete(fullUrl, headers, jsonInput); + HttpRequestForOry.Response response = HttpRequestForOry.doJsonDelete(fullUrl, headers, jsonInput); // Response transformations response.jsonResponse = Transformations.transformJsonResponseFromHydra(main, appIdentifier, response.jsonResponse); @@ -275,7 +275,7 @@ public static HttpRequest.Response doOAuthProxyJsonDELETE(Main main, AppIdentifi return response; } - private static void checkNonSuccessResponse(HttpRequest.Response response) throws OAuthAPIException, OAuthClientNotFoundException { + private static void checkNonSuccessResponse(HttpRequestForOry.Response response) throws OAuthAPIException, OAuthClientNotFoundException { if (response.statusCode == 404) { throw new OAuthClientNotFoundException(); } diff --git a/src/main/java/io/supertokens/webserver/api/oauth/CreateUpdateOrGetOAuthClientAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/CreateUpdateOrGetOAuthClientAPI.java index d3b9e8d57..108cba0ca 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/CreateUpdateOrGetOAuthClientAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/CreateUpdateOrGetOAuthClientAPI.java @@ -26,7 +26,7 @@ import io.supertokens.Main; import io.supertokens.featureflag.exceptions.FeatureNotEnabledException; import io.supertokens.multitenancy.exception.BadPermissionException; -import io.supertokens.oauth.HttpRequest; +import io.supertokens.oauth.HttpRequestForOry; import io.supertokens.oauth.OAuth; import io.supertokens.oauth.exceptions.OAuthAPIException; import io.supertokens.oauth.exceptions.OAuthClientNotFoundException; @@ -65,7 +65,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IO true, // camelToSnakeCaseConversion OAuthProxyHelper.defaultGetQueryParamsFromRequest(req), new HashMap<>(), // getHeadersForProxy - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse return jsonBody.getAsJsonObject(); } ); @@ -93,7 +93,7 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws I true, // camelToSnakeCaseConversion input, // jsonBody new HashMap<>(), // headers - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse String clientId = jsonBody.getAsJsonObject().get("clientId").getAsString(); try { @@ -120,7 +120,7 @@ protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws IO try { Map queryParams = new HashMap<>(); queryParams.put("clientId", clientId); - HttpRequest.Response response = OAuth.doOAuthProxyGET( + HttpRequestForOry.Response response = OAuth.doOAuthProxyGET( main, getAppIdentifier(req), enforcePublicTenantAndGetPublicTenantStorage(req), @@ -151,7 +151,7 @@ protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws IO new HashMap<>(), // queryParams input, // jsonBody new HashMap<>(), // headers - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse return jsonBody.getAsJsonObject(); } ); diff --git a/src/main/java/io/supertokens/webserver/api/oauth/OAuthAcceptAuthConsentRequestAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/OAuthAcceptAuthConsentRequestAPI.java index b4e9447ab..2e3f814dc 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/OAuthAcceptAuthConsentRequestAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/OAuthAcceptAuthConsentRequestAPI.java @@ -41,7 +41,7 @@ protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws IO OAuthProxyHelper.defaultGetQueryParamsFromRequest(req), input, // jsonBody new HashMap<>(), // headers - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse JsonObject response = jsonBody.getAsJsonObject(); response.addProperty("status", "OK"); return response; diff --git a/src/main/java/io/supertokens/webserver/api/oauth/OAuthAuthAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/OAuthAuthAPI.java index 944f37600..a8752f6bf 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/OAuthAuthAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/OAuthAuthAPI.java @@ -73,7 +73,7 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws I false, // camelToSnakeCaseConversion queryParams, headers, - (statusCode, responseHeaders, rawBody, jsonBody) -> { // handleResponse + (statusCode, responseHeaders, rawBody, jsonBody) -> { // getJsonResponse if (headers == null || !responseHeaders.containsKey("Location")) { throw new IllegalStateException("Invalid response from hydra"); } diff --git a/src/main/java/io/supertokens/webserver/api/oauth/OAuthClientListAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/OAuthClientListAPI.java index 96bc6a5d6..d177c7fcf 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/OAuthClientListAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/OAuthClientListAPI.java @@ -44,7 +44,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IO true, // camelToSnakeCaseConversion new HashMap<>(), // queryParams new HashMap<>(), // headers - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse JsonObject response = new JsonObject(); response.addProperty("status", "OK"); diff --git a/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthConsentRequestAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthConsentRequestAPI.java index e7432dbe9..4faa5e65f 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthConsentRequestAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthConsentRequestAPI.java @@ -37,7 +37,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IO true, // camelToSnakeCaseConversion OAuthProxyHelper.defaultGetQueryParamsFromRequest(req), new HashMap<>(), // headers - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse JsonObject response = jsonBody.getAsJsonObject(); response.addProperty("status", "OK"); return response; diff --git a/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthLoginRequestAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthLoginRequestAPI.java index 4d3546720..ca9a4af6a 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthLoginRequestAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthLoginRequestAPI.java @@ -37,7 +37,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IO true, // camelToSnakeCaseConversion OAuthProxyHelper.defaultGetQueryParamsFromRequest(req), new HashMap<>(), // headers - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse JsonObject response = jsonBody.getAsJsonObject(); response.addProperty("status", "OK"); return response; diff --git a/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthLogoutRequestAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthLogoutRequestAPI.java index 308c3164f..0b4f9433f 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthLogoutRequestAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/OAuthGetAuthLogoutRequestAPI.java @@ -37,7 +37,7 @@ protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IO true, // camelToSnakeCaseConversion OAuthProxyHelper.defaultGetQueryParamsFromRequest(req), new HashMap<>(), // headers - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse JsonObject response = jsonBody.getAsJsonObject(); response.addProperty("status", "OK"); return response; diff --git a/src/main/java/io/supertokens/webserver/api/oauth/OAuthProxyHelper.java b/src/main/java/io/supertokens/webserver/api/oauth/OAuthProxyHelper.java index 58855afa4..a4acb0593 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/OAuthProxyHelper.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/OAuthProxyHelper.java @@ -13,7 +13,7 @@ import io.supertokens.Main; import io.supertokens.featureflag.exceptions.FeatureNotEnabledException; -import io.supertokens.oauth.HttpRequest; +import io.supertokens.oauth.HttpRequestForOry; import io.supertokens.oauth.OAuth; import io.supertokens.oauth.exceptions.OAuthAPIException; import io.supertokens.oauth.exceptions.OAuthClientNotFoundException; @@ -35,7 +35,7 @@ public static void proxyGET(Main main, HttpServletRequest req, HttpServletRespon Map queryParams, Map headers, GetJsonResponse getJsonResponse) throws IOException, ServletException { try { - HttpRequest.Response response = OAuth.doOAuthProxyGET(main, appIdentifier, storage, path, proxyToAdmin, camelToSnakeCaseConversion, queryParams, headers); + HttpRequestForOry.Response response = OAuth.doOAuthProxyGET(main, appIdentifier, storage, path, proxyToAdmin, camelToSnakeCaseConversion, queryParams, headers); JsonObject jsonResponse = getJsonResponse.apply( response.statusCode, @@ -61,7 +61,7 @@ public static void proxyFormPOST(Main main, HttpServletRequest req, HttpServletR Map formFields, Map headers, GetJsonResponse getJsonResponse) throws IOException, ServletException { try { - HttpRequest.Response response = OAuth.doOAuthProxyFormPOST(main, appIdentifier, storage, path, proxyToAdmin, camelToSnakeCaseConversion, formFields, headers); + HttpRequestForOry.Response response = OAuth.doOAuthProxyFormPOST(main, appIdentifier, storage, path, proxyToAdmin, camelToSnakeCaseConversion, formFields, headers); JsonObject jsonResponse = getJsonResponse.apply( response.statusCode, @@ -87,7 +87,7 @@ public static void proxyJsonPOST(Main main, HttpServletRequest req, HttpServletR JsonObject jsonInput, Map headers, GetJsonResponse getJsonResponse) throws IOException, ServletException { try { - HttpRequest.Response response = OAuth.doOAuthProxyJsonPOST(main, appIdentifier, storage, path, proxyToAdmin, camelToSnakeCaseConversion, jsonInput, headers); + HttpRequestForOry.Response response = OAuth.doOAuthProxyJsonPOST(main, appIdentifier, storage, path, proxyToAdmin, camelToSnakeCaseConversion, jsonInput, headers); JsonObject jsonResponse = getJsonResponse.apply( response.statusCode, @@ -114,7 +114,7 @@ public static void proxyJsonPUT(Main main, HttpServletRequest req, HttpServletRe Map headers, GetJsonResponse getJsonResponse) throws IOException, ServletException { try { - HttpRequest.Response response = OAuth.doOAuthProxyJsonPUT(main, appIdentifier, storage, path, proxyToAdmin, camelToSnakeCaseConversion, queryParams, jsonInput, headers); + HttpRequestForOry.Response response = OAuth.doOAuthProxyJsonPUT(main, appIdentifier, storage, path, proxyToAdmin, camelToSnakeCaseConversion, queryParams, jsonInput, headers); JsonObject jsonResponse = getJsonResponse.apply( response.statusCode, @@ -140,7 +140,7 @@ public static void proxyJsonDELETE(Main main, HttpServletRequest req, HttpServle JsonObject jsonInput, Map headers, GetJsonResponse getJsonResponse) throws IOException, ServletException { try { - HttpRequest.Response response = OAuth.doOAuthProxyJsonDELETE(main, appIdentifier, storage, path, proxyToAdmin, camelToSnakeCaseConversion, jsonInput, headers); + HttpRequestForOry.Response response = OAuth.doOAuthProxyJsonDELETE(main, appIdentifier, storage, path, proxyToAdmin, camelToSnakeCaseConversion, jsonInput, headers); JsonObject jsonResponse = getJsonResponse.apply( response.statusCode, diff --git a/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthConsentRequestAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthConsentRequestAPI.java index c90639573..cc886d09d 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthConsentRequestAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthConsentRequestAPI.java @@ -41,7 +41,7 @@ protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws IO OAuthProxyHelper.defaultGetQueryParamsFromRequest(req), input, // getJsonBody new HashMap<>(), // getHeadersForProxy - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse JsonObject response = jsonBody.getAsJsonObject(); response.addProperty("status", "OK"); return response; diff --git a/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthLoginRequestAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthLoginRequestAPI.java index c6cd0f9e5..ea676b754 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthLoginRequestAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthLoginRequestAPI.java @@ -42,7 +42,7 @@ protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws IO OAuthProxyHelper.defaultGetQueryParamsFromRequest(req), input, // jsonBody new HashMap<>(), // headers - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse JsonObject response = jsonBody.getAsJsonObject(); response.addProperty("status", "OK"); return response; diff --git a/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthLogoutRequestAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthLogoutRequestAPI.java index a43309e62..dca66535f 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthLogoutRequestAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/OAuthRejectAuthLogoutRequestAPI.java @@ -41,7 +41,7 @@ protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws IO OAuthProxyHelper.defaultGetQueryParamsFromRequest(req), input, // jsonBody new HashMap<>(), // headers - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse JsonObject response = jsonBody.getAsJsonObject(); response.addProperty("status", "OK"); return response; diff --git a/src/main/java/io/supertokens/webserver/api/oauth/OAuthTokenIntrospectAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/OAuthTokenIntrospectAPI.java index 607e5780f..101f56e09 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/OAuthTokenIntrospectAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/OAuthTokenIntrospectAPI.java @@ -71,7 +71,7 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws I false, // camelToSnakeCaseConversion formFields, new HashMap<>(), // getHeaders - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse JsonObject response = jsonBody.getAsJsonObject(); response.addProperty("iss", iss); diff --git a/src/main/java/io/supertokens/webserver/api/oauth/RemoveOAuthClientAPI.java b/src/main/java/io/supertokens/webserver/api/oauth/RemoveOAuthClientAPI.java index 2a58a4427..1063c667f 100644 --- a/src/main/java/io/supertokens/webserver/api/oauth/RemoveOAuthClientAPI.java +++ b/src/main/java/io/supertokens/webserver/api/oauth/RemoveOAuthClientAPI.java @@ -60,7 +60,7 @@ protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws I true, // camelToSnakeCaseConversion new JsonObject(), // getJsonBody new HashMap<>(), // getHeadersForProxy - (statusCode, headers, rawBody, jsonBody) -> { // handleResponse + (statusCode, headers, rawBody, jsonBody) -> { // getJsonResponse try { OAuth.removeClientId(main, getAppIdentifier(req), enforcePublicTenantAndGetPublicTenantStorage(req), clientId); } catch (StorageQueryException | TenantOrAppNotFoundException | BadPermissionException e) {