KEYCLOAK-4224 Allow hiding identity providers on login page

This commit is contained in:
Slawomir Dabek committed 2017-01-17 14:32:59 +01:00
1 parent bea8de8a1a
commit 9bb65ba9b7
13 files changed
+170 -15

No files matched your search

@@ -87,6 +87,13 @@ public class IdentityProviderHintTest {
assertTrue(this.driver.getCurrentUrl().startsWith("http://localhost:8081/test-app"));
assertTrue(this.driver.getPageSource().contains("idToken"));
}
@Test
public void testSuccessfulRedirectToProviderHiddenOnLoginPage() {
this.driver.navigate().to("http://localhost:8081/test-app?kc_idp_hint=kc-oidc-idp-hidden");
assertTrue(this.driver.getCurrentUrl().startsWith("http://localhost:8082/auth/"));
}
@Test
public void testInvalidIdentityProviderHint() {
@@ -143,13 +143,13 @@ public class LoginPage extends AbstractPage {
registerLink.click();
}
public void clickSocial(String providerId) {
WebElement socialButton = findSocialButton(providerId);
public void clickSocial(String alias) {
WebElement socialButton = findSocialButton(alias);
socialButton.click();
}
public WebElement findSocialButton(String providerId) {
String id = "zocial-" + providerId;
public WebElement findSocialButton(String alias) {
String id = "zocial-" + alias;
return this.driver.findElement(By.id(id));
}
@@ -205,6 +205,24 @@
"defaultScope": "email profile",
"backchannelSupported": "true"
}
},
{
"alias" : "kc-oidc-idp-hidden",
"providerId" : "keycloak-oidc",
"enabled": true,
"storeToken" : true,
"addReadTokenRoleOnCreate": true,
"config": {
"clientId": "broker-app",
"clientSecret": "secret",
"authorizationUrl": "http://localhost:8082/auth/realms/realm-with-oidc-idp-hidden/protocol/openid-connect/auth",
"tokenUrl": "http://localhost:8082/auth/realms/realm-with-oidc-idp-hidden/protocol/openid-connect/token",
"userInfoUrl": "http://localhost:8082/auth/realms/realm-with-oidc-idp-hidden/protocol/openid-connect/userinfo",
"logoutUrl": "http://localhost:8082/auth/realms/realm-with-oidc-idp-hidden/protocol/openid-connect/logout",
"defaultScope": "email profile",
"backchannelSupported": "true",
"hideOnLoginPage": true
}
}
],
"identityProviderMappers": [