diff --git a/server-spi/src/main/java/org/keycloak/models/IdentityProviderModel.java b/server-spi/src/main/java/org/keycloak/models/IdentityProviderModel.java index 101c20951e..7f01927279 100755 --- a/server-spi/src/main/java/org/keycloak/models/IdentityProviderModel.java +++ b/server-spi/src/main/java/org/keycloak/models/IdentityProviderModel.java @@ -205,6 +205,10 @@ public class IdentityProviderModel implements Serializable { this.displayName = displayName; } + public String getDisplayIconClasses() { + return null; + } + /** *
Validates this configuration.
*
diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/model/IdentityProviderBean.java b/services/src/main/java/org/keycloak/forms/login/freemarker/model/IdentityProviderBean.java
index f8f89930df..2e1b04a349 100755
--- a/services/src/main/java/org/keycloak/forms/login/freemarker/model/IdentityProviderBean.java
+++ b/services/src/main/java/org/keycloak/forms/login/freemarker/model/IdentityProviderBean.java
@@ -73,18 +73,21 @@ public class IdentityProviderBean {
if (!hideOnLoginPage) {
orderedSet.add(new IdentityProvider(identityProvider.getAlias(),
displayName, identityProvider.getProviderId(), loginUrl,
- config != null ? config.get("guiOrder") : null, getLoginIconClasses(identityProvider.getAlias())));
+ config != null ? config.get("guiOrder") : null, getLoginIconClasses(identityProvider)));
}
}
// Get icon classes defined in properties of current theme with key 'kcLogoIdP-{alias}'
+ // OR from IdentityProviderModel.getDisplayIconClasses if not defined in theme (for third-party IDPs like Sign-In-With-Apple)
// f.e. kcLogoIdP-github = fa fa-github
- private String getLoginIconClasses(String alias) {
+ private String getLoginIconClasses(IdentityProviderModel identityProvider) {
final String ICON_THEME_PREFIX = "kcLogoIdP-";
try {
Theme theme = session.theme().getTheme(Theme.Type.LOGIN);
- return Optional.ofNullable(theme.getProperties().getProperty(ICON_THEME_PREFIX + alias)).orElse("");
+ Optional