From 3d42573813df086fcec9e05958d03be3378ae7e3 Mon Sep 17 00:00:00 2001 From: Tomas Ondrusko <67582554+tondrusk@users.noreply.github.com> Date: Thu, 28 Sep 2023 11:34:45 +0200 Subject: [PATCH] Update PayPal social login flow to use 127.0.0.1 instead of localhost (#23532) Signed-off-by: Tomas Ondrusko --- .../main/java/org/keycloak/testsuite/util/OAuthClient.java | 4 ++++ .../org/keycloak/testsuite/broker/SocialLoginTest.java | 7 ++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/OAuthClient.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/OAuthClient.java index 606ea6ec05..b2331fbf99 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/OAuthClient.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/util/OAuthClient.java @@ -1475,6 +1475,10 @@ public class OAuthClient { } public String getLoginFormUrl() { + return this.getLoginFormUrl(this.baseUrl); + } + + public String getLoginFormUrl(String baseUrl) { UriBuilder b = OIDCLoginProtocolService.authUrl(UriBuilder.fromUri(baseUrl)); if (responseType != null) { b.queryParam(OAuth2Constants.RESPONSE_TYPE, responseType); diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java index c8ddb277f1..0520df1d3c 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/broker/SocialLoginTest.java @@ -516,7 +516,12 @@ public class SocialLoginTest extends AbstractKeycloakTest { private void navigateToLoginPage() { currentSocialLoginPage.logout(); // try to logout first to be sure we're not logged in - driver.navigate().to(oauth.getLoginFormUrl()); + + driver.navigate().to( + currentTestProvider.equals(PAYPAL) + ? oauth.getLoginFormUrl("https://127.0.0.1:8543/auth") + : oauth.getLoginFormUrl() + ); loginPage.clickSocial(currentTestProvider.id()); // Just to be sure there's no redirect in progress