Update PayPal social login flow to use 127.0.0.1 instead of localhost (#23532)

Signed-off-by: Tomas Ondrusko <tondrusk@redhat.com>
This commit is contained in:
Tomas Ondrusko 2023-09-28 11:34:45 +02:00 committed by GitHub
parent 56082cdd2d
commit 3d42573813
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View file

@ -1475,6 +1475,10 @@ public class OAuthClient {
} }
public String getLoginFormUrl() { public String getLoginFormUrl() {
return this.getLoginFormUrl(this.baseUrl);
}
public String getLoginFormUrl(String baseUrl) {
UriBuilder b = OIDCLoginProtocolService.authUrl(UriBuilder.fromUri(baseUrl)); UriBuilder b = OIDCLoginProtocolService.authUrl(UriBuilder.fromUri(baseUrl));
if (responseType != null) { if (responseType != null) {
b.queryParam(OAuth2Constants.RESPONSE_TYPE, responseType); b.queryParam(OAuth2Constants.RESPONSE_TYPE, responseType);

View file

@ -516,7 +516,12 @@ public class SocialLoginTest extends AbstractKeycloakTest {
private void navigateToLoginPage() { private void navigateToLoginPage() {
currentSocialLoginPage.logout(); // try to logout first to be sure we're not logged in 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()); loginPage.clickSocial(currentTestProvider.id());
// Just to be sure there's no redirect in progress // Just to be sure there's no redirect in progress