From f00c2f3eb0bbc283fe3dfaa23ad62dba84597503 Mon Sep 17 00:00:00 2001 From: "e.sergeenko" Date: Fri, 7 Jun 2024 11:20:04 +0300 Subject: [PATCH] Add ability to get realm attributes Closes #30241 Signed-off-by: e.sergeenko --- .../forms/login/freemarker/model/RealmBean.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/forms/login/freemarker/model/RealmBean.java b/services/src/main/java/org/keycloak/forms/login/freemarker/model/RealmBean.java index 57832fbf8f..1445420446 100755 --- a/services/src/main/java/org/keycloak/forms/login/freemarker/model/RealmBean.java +++ b/services/src/main/java/org/keycloak/forms/login/freemarker/model/RealmBean.java @@ -22,6 +22,7 @@ import org.keycloak.authentication.actiontoken.verifyemail.VerifyEmailActionToke import org.keycloak.models.RealmModel; import org.keycloak.representations.idm.CredentialRepresentation; +import java.util.Map; import java.util.Objects; import java.util.concurrent.TimeUnit; @@ -69,7 +70,7 @@ public class RealmBean { public boolean isRegistrationEmailAsUsername() { return realm.isRegistrationEmailAsUsername(); } - + public boolean isLoginWithEmailAllowed() { return realm.isLoginWithEmailAllowed(); } @@ -130,4 +131,12 @@ public class RealmBean { public int getIdpVerifyAccountLinkActionTokenLifespanMinutes() { return (int)TimeUnit.SECONDS.toMinutes(realm.getActionTokenGeneratedByUserLifespan(IdpVerifyAccountLinkActionToken.TOKEN_TYPE)); } + + public Map getAttributes() { + return realm.getAttributes(); + } + + public String getAttribute(String key) { + return realm.getAttribute(key); + } }