Merge pull request #1955 from stianst/master

Support for branding
This commit is contained in:
Stian Thorgersen 2015-12-21 12:00:56 +00:00
commit 18268f686c
33 changed files with 225 additions and 52 deletions

View file

@ -12,6 +12,8 @@ import java.util.Properties;
*/ */
public class Version { public class Version {
public static final String UNKNOWN = "UNKNOWN"; public static final String UNKNOWN = "UNKNOWN";
public static String NAME;
public static String NAME_HTML;
public static String VERSION; public static String VERSION;
public static String RESOURCES_VERSION; public static String RESOURCES_VERSION;
public static String BUILD_TIME; public static String BUILD_TIME;
@ -21,6 +23,8 @@ public class Version {
InputStream is = Version.class.getResourceAsStream("/keycloak-version.properties"); InputStream is = Version.class.getResourceAsStream("/keycloak-version.properties");
try { try {
props.load(is); props.load(is);
Version.NAME = props.getProperty("name");
Version.NAME_HTML = props.getProperty("name-html");
Version.VERSION = props.getProperty("version"); Version.VERSION = props.getProperty("version");
Version.BUILD_TIME = props.getProperty("build-time"); Version.BUILD_TIME = props.getProperty("build-time");
Version.RESOURCES_VERSION = Version.VERSION.toLowerCase(); Version.RESOURCES_VERSION = Version.VERSION.toLowerCase();

View file

@ -1,2 +1,4 @@
name=${product.name}
name-html=${product.name-html}
version=${product.version} version=${product.version}
build-time=${product.build-time} build-time=${product.build-time}

View file

@ -9,6 +9,8 @@ import java.util.*;
public class RealmRepresentation { public class RealmRepresentation {
protected String id; protected String id;
protected String realm; protected String realm;
protected String displayName;
protected String displayNameHtml;
protected Integer notBefore; protected Integer notBefore;
protected Boolean revokeRefreshToken; protected Boolean revokeRefreshToken;
protected Integer accessTokenLifespan; protected Integer accessTokenLifespan;
@ -129,6 +131,22 @@ public class RealmRepresentation {
this.realm = realm; this.realm = realm;
} }
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getDisplayNameHtml() {
return displayNameHtml;
}
public void setDisplayNameHtml(String displayNameHtml) {
this.displayNameHtml = displayNameHtml;
}
public List<UserRepresentation> getUsers() { public List<UserRepresentation> getUsers() {
return users; return users;
} }

View file

@ -1,6 +1,8 @@
# Common messages # Common messages
enabled=Enabled enabled=Enabled
name=Name name=Name
displayName=Display name
displayNameHtml=HTML Display name
save=Save save=Save
cancel=Cancel cancel=Cancel
onText=ON onText=ON

View file

@ -9,6 +9,20 @@
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-md-2 control-label" for="name">{{:: 'displayName' | translate}}</label>
<div class="col-md-6">
<input class="form-control" type="text" id="displayName" name="displayName" data-ng-model="realm.displayName">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label" for="name">{{:: 'displayNameHtml' | translate}}</label>
<div class="col-md-6">
<input class="form-control" type="text" id="displayNameHtml" name="displayNameHtml" data-ng-model="realm.displayNameHtml">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label" for="enabled">{{:: 'enabled' | translate}}</label> <label class="col-md-2 control-label" for="enabled">{{:: 'enabled' | translate}}</label>
<div class="col-md-6"> <div class="col-md-6">

View file

@ -6,7 +6,7 @@
${msg("emailLinkIdpTitle", idpAlias)} ${msg("emailLinkIdpTitle", idpAlias)}
<#elseif section = "form"> <#elseif section = "form">
<p id="instruction1" class="instruction"> <p id="instruction1" class="instruction">
${msg("emailLinkIdp1", idpAlias, brokerContext.username, realm.name)} ${msg("emailLinkIdp1", idpAlias, brokerContext.username, realm.displayName)}
</p> </p>
<p id="instruction2" class="instruction"> <p id="instruction2" class="instruction">
${msg("emailLinkIdp2")} <a href="${url.firstBrokerLoginUrl}">${msg("doClickHere")}</a> ${msg("emailLinkIdp3")} ${msg("emailLinkIdp2")} <a href="${url.firstBrokerLoginUrl}">${msg("doClickHere")}</a> ${msg("emailLinkIdp3")}

View file

@ -3,7 +3,7 @@
<#if section = "title"> <#if section = "title">
${msg("oauthGrantTitle")} ${msg("oauthGrantTitle")}
<#elseif section = "header"> <#elseif section = "header">
${msg("oauthGrantTitleHtml",(realm.name!''))} <strong><#if client.name??>${advancedMsg(client.name)}<#else>${client.clientId}</#if></strong>. ${msg("oauthGrantTitleHtml",(realm.displayNameHtml!''))} <strong><#if client.name??>${advancedMsg(client.name)}<#else>${client.clientId}</#if></strong>.
<#elseif section = "form"> <#elseif section = "form">
<div id="kc-oauth" class="content-area"> <div id="kc-oauth" class="content-area">
<h3>${msg("oauthGrantRequest")}</h3> <h3>${msg("oauthGrantRequest")}</h3>

View file

@ -1,9 +1,9 @@
<#import "template.ftl" as layout> <#import "template.ftl" as layout>
<@layout.registrationLayout; section> <@layout.registrationLayout; section>
<#if section = "title"> <#if section = "title">
${msg("loginTitle",realm.name)} ${msg("loginTitle",realm.displayName)}
<#elseif section = "header"> <#elseif section = "header">
${msg("loginTitleHtml",realm.name)} ${msg("loginTitleHtml",realm.displayNameHtml)}
<#elseif section = "form"> <#elseif section = "form">
<form id="kc-totp-login-form" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post"> <form id="kc-totp-login-form" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post">
<div class="${properties.kcFormGroupClass!}"> <div class="${properties.kcFormGroupClass!}">

View file

@ -1,9 +1,9 @@
<#import "template.ftl" as layout> <#import "template.ftl" as layout>
<@layout.registrationLayout displayInfo=social.displayInfo; section> <@layout.registrationLayout displayInfo=social.displayInfo; section>
<#if section = "title"> <#if section = "title">
${msg("loginTitle",(realm.name!''))} ${msg("loginTitle",(realm.displayName!''))}
<#elseif section = "header"> <#elseif section = "header">
${msg("loginTitleHtml",(realm.name!''))} ${msg("loginTitleHtml",(realm.displayNameHtml!''))}
<#elseif section = "form"> <#elseif section = "form">
<#if realm.password> <#if realm.password>
<form id="kc-form-login" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post"> <form id="kc-form-login" class="${properties.kcFormClass!}" action="${url.loginAction}" method="post">

View file

@ -15,9 +15,9 @@ kerberosNotConfiguredTitle=Kerberos no configurat
bypassKerberosDetail=O b\u00E9 no est\u00E0s identificat mitjan\u00E7ant Kerberos o el teu navegador no est\u00E0 configurat per identificar-se mitjan\u00E7ant Kerberos. Si us plau fes clic per identificar-te per un altre mitj\u00E0. bypassKerberosDetail=O b\u00E9 no est\u00E0s identificat mitjan\u00E7ant Kerberos o el teu navegador no est\u00E0 configurat per identificar-se mitjan\u00E7ant Kerberos. Si us plau fes clic per identificar-te per un altre mitj\u00E0.
kerberosNotSetUp=Kerberos no est\u00E0 configurat. No pots identificar-te. kerberosNotSetUp=Kerberos no est\u00E0 configurat. No pots identificar-te.
registerWithTitle=Registra''t amb {0} registerWithTitle=Registra''t amb {0}
registerWithTitleHtml=Registra''t amb <strong>{0}</strong> registerWithTitleHtml={0}
loginTitle=Inicia sessi\u00F3 a {0} loginTitle=Inicia sessi\u00F3 a {0}
loginTitleHtml=Inicia sessi\u00F3 a <strong>{0}</strong> loginTitleHtml={0}
impersonateTitle={0}\u00A0Personifica Usuari impersonateTitle={0}\u00A0Personifica Usuari
impersonateTitleHtml=<strong>{0}</strong> Personifica Usuari</strong> impersonateTitleHtml=<strong>{0}</strong> Personifica Usuari</strong>
realmChoice=Domini realmChoice=Domini
@ -26,7 +26,7 @@ loginTotpTitle=Configura la teva aplicaci\u00F3 d''identificaci\u00F3 m\u00F2bil
loginProfileTitle=Actualitza la informaci\u00F3 del teu compte loginProfileTitle=Actualitza la informaci\u00F3 del teu compte
loginTimeout=Has trigat massa a identificar-te. Inicia de nou la identificaci\u00F3. loginTimeout=Has trigat massa a identificar-te. Inicia de nou la identificaci\u00F3.
oauthGrantTitle=Concessi\u00F3 OAuth oauthGrantTitle=Concessi\u00F3 OAuth
oauthGrantTitleHtml=Acc\u00E9s temporal per <strong>{0}</strong> sol\u00B7licitat per oauthGrantTitleHtml={0}
errorTitle=Ho sentim... errorTitle=Ho sentim...
errorTitleHtml=Ho <strong>sentim</strong>... errorTitleHtml=Ho <strong>sentim</strong>...
emailVerifyTitle=Verificaci\u00F3 de l''email emailVerifyTitle=Verificaci\u00F3 de l''email

View file

@ -19,9 +19,9 @@ recaptchaNotConfigured=Recaptcha is required, but not configured
consentDenied=Consent denied. consentDenied=Consent denied.
registerWithTitle=Registrierung bei {0} registerWithTitle=Registrierung bei {0}
registerWithTitleHtml=Registrierung bei <strong>{0}</strong> registerWithTitleHtml={0}
loginTitle=Anmeldung bei {0} loginTitle=Anmeldung bei {0}
loginTitleHtml=Anmeldung bei <strong>{0}</strong> loginTitleHtml={0}
loginOauthTitle= loginOauthTitle=
loginOauthTitleHtml=Tempor\u00E4rer zugriff auf <strong>{0}</strong> angefordert von <strong>{1}</strong>. loginOauthTitleHtml=Tempor\u00E4rer zugriff auf <strong>{0}</strong> angefordert von <strong>{1}</strong>.
loginTotpTitle=Mobile Authentifizierung Einrichten loginTotpTitle=Mobile Authentifizierung Einrichten
@ -32,7 +32,7 @@ impersonateTitleHtml=<strong>{0}</strong> Impersonate User</strong>
unknownUser=Unknown user unknownUser=Unknown user
realmChoice=Realm realmChoice=Realm
oauthGrantTitle=OAuth gew\u00E4hren oauthGrantTitle=OAuth gew\u00E4hren
oauthGrantTitleHtml=Tempor\u00E4rer zugriff auf <strong>{0}</strong> angefordert von oauthGrantTitleHtml={0}
errorTitle=Es tut uns leid... errorTitle=Es tut uns leid...
errorTitleHtml=Es tut uns leid... errorTitleHtml=Es tut uns leid...
emailVerifyTitle=E-Mail verifizieren emailVerifyTitle=E-Mail verifizieren

View file

@ -15,9 +15,9 @@ kerberosNotConfiguredTitle=Kerberos Not Configured
bypassKerberosDetail=Either you are not logged in via Kerberos or your browser is not set up for Kerberos login. Please click continue to login in through other means bypassKerberosDetail=Either you are not logged in via Kerberos or your browser is not set up for Kerberos login. Please click continue to login in through other means
kerberosNotSetUp=Kerberos is not set up. You cannot login. kerberosNotSetUp=Kerberos is not set up. You cannot login.
registerWithTitle=Register with {0} registerWithTitle=Register with {0}
registerWithTitleHtml=Register with <strong>{0}</strong> registerWithTitleHtml={0}
loginTitle=Log in to {0} loginTitle=Log in to {0}
loginTitleHtml=Log in to <strong>{0}</strong> loginTitleHtml={0}
impersonateTitle={0} Impersonate User impersonateTitle={0} Impersonate User
impersonateTitleHtml=<strong>{0}</strong> Impersonate User</strong> impersonateTitleHtml=<strong>{0}</strong> Impersonate User</strong>
realmChoice=Realm realmChoice=Realm
@ -25,8 +25,8 @@ unknownUser=Unknown user
loginTotpTitle=Mobile Authenticator Setup loginTotpTitle=Mobile Authenticator Setup
loginProfileTitle=Update Account Information loginProfileTitle=Update Account Information
loginTimeout=You took too long to login. Login process starting from beginning. loginTimeout=You took too long to login. Login process starting from beginning.
oauthGrantTitle=OAuth Grant oauthGrantTitle=Grant Access
oauthGrantTitleHtml=Temporary access for <strong>{0}</strong> requested by oauthGrantTitleHtml={0}
errorTitle=We''re sorry... errorTitle=We''re sorry...
errorTitleHtml=We''re <strong>sorry</strong> ... errorTitleHtml=We''re <strong>sorry</strong> ...
emailVerifyTitle=Email verification emailVerifyTitle=Email verification

View file

@ -15,9 +15,9 @@ kerberosNotConfiguredTitle=Kerberos no configurado
bypassKerberosDetail=O bien no est\u00E1s identificado mediante Kerberos o tu navegador no est\u00E1 configurado para identificarse mediante Kerberos. Por favor haz clic para identificarte por otro medio. bypassKerberosDetail=O bien no est\u00E1s identificado mediante Kerberos o tu navegador no est\u00E1 configurado para identificarse mediante Kerberos. Por favor haz clic para identificarte por otro medio.
kerberosNotSetUp=Kerberos no est\u00E1 configurado. No puedes identificarte. kerberosNotSetUp=Kerberos no est\u00E1 configurado. No puedes identificarte.
registerWithTitle=Reg\u00EDstrate con {0} registerWithTitle=Reg\u00EDstrate con {0}
registerWithTitleHtml=Reg\u00EDstrate con <strong>{0}</strong> registerWithTitleHtml={0}
loginTitle=Inicia sesi\u00F3n en {0} loginTitle=Inicia sesi\u00F3n en {0}
loginTitleHtml=Inicia sesi\u00F3n en {0} loginTitleHtml={0}
impersonateTitle={0}\u00A0Personificar Usuario impersonateTitle={0}\u00A0Personificar Usuario
impersonateTitleHtml=<strong>{0}</strong> Personificar Usuario</strong> impersonateTitleHtml=<strong>{0}</strong> Personificar Usuario</strong>
realmChoice=Dominio realmChoice=Dominio
@ -26,7 +26,7 @@ loginTotpTitle=Configura tu aplicaci\u00F3n de identificaci\u00F3n m\u00F3vil
loginProfileTitle=Actualiza la informaci\u00F3n de tu cuenta loginProfileTitle=Actualiza la informaci\u00F3n de tu cuenta
loginTimeout=Has tardado demasiado en identificarte. Inicia de nuevo la identificaci\u00F3n. loginTimeout=Has tardado demasiado en identificarte. Inicia de nuevo la identificaci\u00F3n.
oauthGrantTitle=Concesi\u00F3n OAuth oauthGrantTitle=Concesi\u00F3n OAuth
oauthGrantTitleHtml=Acceso temporal para <strong>{0}</strong> solicitado por oauthGrantTitleHtml={0}
errorTitle=Lo sentimos... errorTitle=Lo sentimos...
errorTitleHtml=Lo <strong>sentimos</strong>... errorTitleHtml=Lo <strong>sentimos</strong>...
emailVerifyTitle=Verificaci\u00F3n del email emailVerifyTitle=Verificaci\u00F3n del email

View file

@ -15,9 +15,9 @@ kerberosNotConfiguredTitle=Kerberos non configur\u00e9
bypassKerberosDetail=Si vous n''\u00eates pas connect\u00e9 via Kerberos ou bien que votre navigateur n''est pas configur\u00e9 pour la connexion via Kerberos. Veuillez cliquer pour vous connecter via un autre moyen. bypassKerberosDetail=Si vous n''\u00eates pas connect\u00e9 via Kerberos ou bien que votre navigateur n''est pas configur\u00e9 pour la connexion via Kerberos. Veuillez cliquer pour vous connecter via un autre moyen.
kerberosNotSetUp=Kerberos n''est pas configur\u00e9. Connexion impossible. kerberosNotSetUp=Kerberos n''est pas configur\u00e9. Connexion impossible.
registerWithTitle=Enregistrement avec {0} registerWithTitle=Enregistrement avec {0}
registerWithTitleHtml=Enregistrement avec <strong>{0}</strong> registerWithTitleHtml={0}
loginTitle=Se connecter \u00e0 {0} loginTitle=Se connecter \u00e0 {0}
loginTitleHtml=Se connecter \u00e0 <strong>{0}</strong> loginTitleHtml={0}
impersonateTitle={0} utilisateur impersonate impersonateTitle={0} utilisateur impersonate
impersonateTitleHtml=<strong>{0}</strong> utilisateur impersonate</strong> impersonateTitleHtml=<strong>{0}</strong> utilisateur impersonate</strong>
realmChoice=Domaine realmChoice=Domaine
@ -26,7 +26,7 @@ loginTotpTitle=Configuration de l''authentification par mobile
loginProfileTitle=Mise \u00e0 jour du compte loginProfileTitle=Mise \u00e0 jour du compte
loginTimeout=Le temps imparti pour la connexion est \u00e9coul\u00e9. Le processus de connexion red\u00e9marre depuis le d\u00e9but. loginTimeout=Le temps imparti pour la connexion est \u00e9coul\u00e9. Le processus de connexion red\u00e9marre depuis le d\u00e9but.
oauthGrantTitle=OAuth Grant oauthGrantTitle=OAuth Grant
oauthGrantTitleHtml=Acc\u00e8s temporaire pour <strong>{0}</strong> demand\u00e9 par oauthGrantTitleHtml={0}
errorTitle=Nous sommes d\u00e9sol\u00e9 ... errorTitle=Nous sommes d\u00e9sol\u00e9 ...
errorTitleHtml=Nous sommes <strong>d\u00e9sol\u00e9</strong> ... errorTitleHtml=Nous sommes <strong>d\u00e9sol\u00e9</strong> ...
emailVerifyTitle=V\u00e9rification du courriel emailVerifyTitle=V\u00e9rification du courriel

View file

@ -19,9 +19,9 @@ recaptchaNotConfigured=Recaptcha is required, but not configured
consentDenied=Consent denied. consentDenied=Consent denied.
registerWithTitle=Registrati come {0} registerWithTitle=Registrati come {0}
registerWithTitleHtml=Registrati come <strong>{0}</strong> registerWithTitleHtml={0}
loginTitle=Accedi a {0} loginTitle=Accedi a {0}
loginTitleHtml=Accedi a <strong>{0}</strong> loginTitleHtml={0}
loginTotpTitle=Configura Autenticazione Mobile loginTotpTitle=Configura Autenticazione Mobile
loginProfileTitle=Aggiorna Profilo loginProfileTitle=Aggiorna Profilo
loginTimeout=You took too long to login. Login process starting from beginning. loginTimeout=You took too long to login. Login process starting from beginning.
@ -30,7 +30,7 @@ impersonateTitleHtml=<strong>{0}</strong> Impersonate User</strong>
unknownUser=Unknown user unknownUser=Unknown user
realmChoice=Realm realmChoice=Realm
oauthGrantTitle=OAuth Grant oauthGrantTitle=OAuth Grant
oauthGrantTitleHtml=Accesso temporaneo per <strong>{0}</strong> richiesto da oauthGrantTitleHtml={0}
errorTitle=Siamo spiacenti... errorTitle=Siamo spiacenti...
errorTitleHtml=Siamo <strong>spiacenti</strong> ... errorTitleHtml=Siamo <strong>spiacenti</strong> ...
emailVerifyTitle=Verifica Email emailVerifyTitle=Verifica Email

View file

@ -15,9 +15,9 @@ kerberosNotConfiguredTitle=Kerberos N\u00E3o Configurado
bypassKerberosDetail=Ou voc\u00EA n\u00E3o est\u00E1 logado via Kerberos ou o seu navegador n\u00E3o est\u00E1 configurado para login Kerberos. Por favor, clique em continuar para fazer o login no atrav\u00E9s de outros meios bypassKerberosDetail=Ou voc\u00EA n\u00E3o est\u00E1 logado via Kerberos ou o seu navegador n\u00E3o est\u00E1 configurado para login Kerberos. Por favor, clique em continuar para fazer o login no atrav\u00E9s de outros meios
kerberosNotSetUp=Kerberos n\u00E3o est\u00E1 configurado. Voc\u00EA n\u00E3o pode acessar. kerberosNotSetUp=Kerberos n\u00E3o est\u00E1 configurado. Voc\u00EA n\u00E3o pode acessar.
registerWithTitle=Registre-se com {0} registerWithTitle=Registre-se com {0}
registerWithTitleHtml=Registre-se com <strong>{0}</strong> registerWithTitleHtml={0}
loginTitle=Entrar em {0} loginTitle=Entrar em {0}
loginTitleHtml=Entrar em <strong>{0}</strong> loginTitleHtml={0}
impersonateTitle={0} Impersonate User impersonateTitle={0} Impersonate User
impersonateTitleHtml=<strong>{0}</strong> Impersonate User</strong> impersonateTitleHtml=<strong>{0}</strong> Impersonate User</strong>
realmChoice=Realm realmChoice=Realm
@ -26,7 +26,7 @@ loginTotpTitle=Configura\u00E7\u00E3o do autenticador mobile
loginProfileTitle=Atualiza\u00E7\u00E3o das Informa\u00E7\u00F5es da Conta loginProfileTitle=Atualiza\u00E7\u00E3o das Informa\u00E7\u00F5es da Conta
loginTimeout=Voc\u00EA demorou muito para entrar. Por favor, refa\u00E7a o processo de login a partir do in\u00EDcio. loginTimeout=Voc\u00EA demorou muito para entrar. Por favor, refa\u00E7a o processo de login a partir do in\u00EDcio.
oauthGrantTitle=Concess\u00E3o OAuth oauthGrantTitle=Concess\u00E3o OAuth
oauthGrantTitleHtml=Acesso tempor\u00E1rio para <strong>{0}</strong> solicitado pela oauthGrantTitleHtml={0}
errorTitle=N\u00F3s lamentamos... errorTitle=N\u00F3s lamentamos...
errorTitleHtml=N\u00F3s <strong>lamentamos</strong> ... errorTitleHtml=N\u00F3s <strong>lamentamos</strong> ...
emailVerifyTitle=Verifica\u00E7\u00E3o de e-mail emailVerifyTitle=Verifica\u00E7\u00E3o de e-mail

View file

@ -1,9 +1,9 @@
<#import "template.ftl" as layout> <#import "template.ftl" as layout>
<@layout.registrationLayout; section> <@layout.registrationLayout; section>
<#if section = "title"> <#if section = "title">
${msg("registerWithTitle",(realm.name!''))} ${msg("registerWithTitle",(realm.displayName!''))}
<#elseif section = "header"> <#elseif section = "header">
${msg("registerWithTitleHtml",(realm.name!''))} ${msg("registerWithTitleHtml",(realm.displayNameHtml!''))}
<#elseif section = "form"> <#elseif section = "form">
<form id="kc-register-form" class="${properties.kcFormClass!}" action="${url.registrationAction}" method="post"> <form id="kc-register-form" class="${properties.kcFormClass!}" action="${url.registrationAction}" method="post">
<#if !realm.registrationEmailAsUsername> <#if !realm.registrationEmailAsUsername>

View file

@ -29,7 +29,7 @@
</head> </head>
<body class="${properties.kcBodyClass!}"> <body class="${properties.kcBodyClass!}">
<div id="kc-logo"><div id="kc-logo-wrapper"></div></div> <div id="kc-logo"><a href="${properties.kcLogoLink!'#'}"><div id="kc-logo-wrapper"></div></a></div>
<div id="kc-container" class="${properties.kcContainerClass!}"> <div id="kc-container" class="${properties.kcContainerClass!}">
<div id="kc-container-wrapper" class="${properties.kcContainerWrapperClass!}"> <div id="kc-container-wrapper" class="${properties.kcContainerWrapperClass!}">

View file

@ -74,11 +74,12 @@
#kc-logo-wrapper { #kc-logo-wrapper {
background-image: url("../img/keycloak-logo.png"); background-image: url("../img/keycloak-logo.png");
background-repeat: no-repeat; background-repeat: no-repeat;
background-position: top right;
position: absolute;
top: 50px;
right: 50px;
height: 37px; height: 37px;
width: 154px;
margin: 50px;
} }
#kc-header { #kc-header {
@ -281,8 +282,8 @@ ol#kc-totp-settings li:first-of-type {
@media (max-width: 767px) { @media (max-width: 767px) {
#kc-logo-wrapper { #kc-logo-wrapper {
margin-top: 30px; top: 15px;
margin-right: 15px; right: 15px;
} }
#kc-header { #kc-header {

View file

@ -6,6 +6,8 @@ meta=viewport==width=device-width,initial-scale=1
kcHtmlClass=login-pf kcHtmlClass=login-pf
kcLogoLink=http://www.keycloak.org
kcContentClass=col-sm-12 col-md-12 col-lg-12 container kcContentClass=col-sm-12 col-md-12 col-lg-12 container
kcContentWrapperClass=row kcContentWrapperClass=row

View file

@ -42,6 +42,24 @@ public class RealmBean {
return realm.getName(); return realm.getName();
} }
public String getDisplayName() {
String displayName = realm.getDisplayName();
if (displayName != null && displayName.length() > 0) {
return displayName;
} else {
return getName();
}
}
public String getDisplayNameHtml() {
String displayNameHtml = realm.getDisplayNameHtml();
if (displayNameHtml != null && displayNameHtml.length() > 0) {
return displayNameHtml;
} else {
return getDisplayName();
}
}
public boolean isIdentityFederationEnabled() { public boolean isIdentityFederationEnabled() {
return realm.isIdentityFederationEnabled(); return realm.isIdentityFederationEnabled();
} }

View file

@ -35,6 +35,14 @@ public interface RealmModel extends RoleContainerModel {
void setName(String name); void setName(String name);
String getDisplayName();
void setDisplayName(String displayName);
String getDisplayNameHtml();
void setDisplayNameHtml(String displayNameHtml);
boolean isEnabled(); boolean isEnabled();
void setEnabled(boolean enabled); void setEnabled(boolean enabled);

View file

@ -11,6 +11,8 @@ import java.util.Map;
public class RealmEntity extends AbstractIdentifiableEntity { public class RealmEntity extends AbstractIdentifiableEntity {
private String name; private String name;
private String displayName;
private String displayNameHtml;
private boolean enabled; private boolean enabled;
private String sslRequired; private String sslRequired;
private boolean registrationAllowed; private boolean registrationAllowed;
@ -105,6 +107,22 @@ public class RealmEntity extends AbstractIdentifiableEntity {
this.name = name; this.name = name;
} }
public String getDisplayName() {
return displayName;
}
public void setDisplayName(String displayName) {
this.displayName = displayName;
}
public String getDisplayNameHtml() {
return displayNameHtml;
}
public void setDisplayNameHtml(String displayNameHtml) {
this.displayNameHtml = displayNameHtml;
}
public boolean isEnabled() { public boolean isEnabled() {
return enabled; return enabled;
} }

View file

@ -164,6 +164,8 @@ public class ModelToRepresentation {
RealmRepresentation rep = new RealmRepresentation(); RealmRepresentation rep = new RealmRepresentation();
rep.setId(realm.getId()); rep.setId(realm.getId());
rep.setRealm(realm.getName()); rep.setRealm(realm.getName());
rep.setDisplayName(realm.getDisplayName());
rep.setDisplayNameHtml(realm.getDisplayNameHtml());
rep.setEnabled(realm.isEnabled()); rep.setEnabled(realm.isEnabled());
rep.setNotBefore(realm.getNotBefore()); rep.setNotBefore(realm.getNotBefore());
rep.setSslRequired(realm.getSslRequired().name().toLowerCase()); rep.setSslRequired(realm.getSslRequired().name().toLowerCase());

View file

@ -85,6 +85,8 @@ public class RepresentationToModel {
convertDeprecatedApplications(session, rep); convertDeprecatedApplications(session, rep);
newRealm.setName(rep.getRealm()); newRealm.setName(rep.getRealm());
if (rep.getDisplayName() != null) newRealm.setDisplayName(rep.getDisplayName());
if (rep.getDisplayNameHtml() != null) newRealm.setDisplayNameHtml(rep.getDisplayNameHtml());
if (rep.isEnabled() != null) newRealm.setEnabled(rep.isEnabled()); if (rep.isEnabled() != null) newRealm.setEnabled(rep.isEnabled());
if (rep.isBruteForceProtected() != null) newRealm.setBruteForceProtected(rep.isBruteForceProtected()); if (rep.isBruteForceProtected() != null) newRealm.setBruteForceProtected(rep.isBruteForceProtected());
if (rep.getMaxFailureWaitSeconds() != null) newRealm.setMaxFailureWaitSeconds(rep.getMaxFailureWaitSeconds()); if (rep.getMaxFailureWaitSeconds() != null) newRealm.setMaxFailureWaitSeconds(rep.getMaxFailureWaitSeconds());
@ -595,6 +597,8 @@ public class RepresentationToModel {
if (rep.getRealm() != null) { if (rep.getRealm() != null) {
realm.setName(rep.getRealm()); realm.setName(rep.getRealm());
} }
if (rep.getDisplayName() != null) realm.setDisplayName(rep.getDisplayName());
if (rep.getDisplayNameHtml() != null) realm.setDisplayNameHtml(rep.getDisplayNameHtml());
if (rep.isEnabled() != null) realm.setEnabled(rep.isEnabled()); if (rep.isEnabled() != null) realm.setEnabled(rep.isEnabled());
if (rep.isBruteForceProtected() != null) realm.setBruteForceProtected(rep.isBruteForceProtected()); if (rep.isBruteForceProtected() != null) realm.setBruteForceProtected(rep.isBruteForceProtected());
if (rep.getMaxFailureWaitSeconds() != null) realm.setMaxFailureWaitSeconds(rep.getMaxFailureWaitSeconds()); if (rep.getMaxFailureWaitSeconds() != null) realm.setMaxFailureWaitSeconds(rep.getMaxFailureWaitSeconds());

View file

@ -59,6 +59,30 @@ public class RealmAdapter implements RealmModel {
updated.setName(name); updated.setName(name);
} }
@Override
public String getDisplayName() {
if (updated != null) return updated.getDisplayName();
return cached.getDisplayName();
}
@Override
public void setDisplayName(String displayName) {
getDelegateForUpdate();
updated.setDisplayName(displayName);
}
@Override
public String getDisplayNameHtml() {
if (updated != null) return updated.getDisplayNameHtml();
return cached.getDisplayNameHtml();
}
@Override
public void setDisplayNameHtml(String displayNameHtml) {
getDelegateForUpdate();
updated.setDisplayNameHtml(displayNameHtml);
}
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
if (updated != null) return updated.isEnabled(); if (updated != null) return updated.isEnabled();

View file

@ -38,6 +38,8 @@ public class CachedRealm implements Serializable {
private String id; private String id;
private String name; private String name;
private String displayName;
private String displayNameHtml;
private boolean enabled; private boolean enabled;
private SslRequired sslRequired; private SslRequired sslRequired;
private boolean registrationAllowed; private boolean registrationAllowed;
@ -125,6 +127,8 @@ public class CachedRealm implements Serializable {
public CachedRealm(RealmCache cache, RealmProvider delegate, RealmModel model) { public CachedRealm(RealmCache cache, RealmProvider delegate, RealmModel model) {
id = model.getId(); id = model.getId();
name = model.getName(); name = model.getName();
displayName = model.getDisplayName();
displayNameHtml = model.getDisplayNameHtml();
enabled = model.isEnabled(); enabled = model.isEnabled();
sslRequired = model.getSslRequired(); sslRequired = model.getSslRequired();
registrationAllowed = model.isRegistrationAllowed(); registrationAllowed = model.isRegistrationAllowed();
@ -265,6 +269,14 @@ public class CachedRealm implements Serializable {
return name; return name;
} }
public String getDisplayName() {
return displayName;
}
public String getDisplayNameHtml() {
return displayNameHtml;
}
public List<String> getDefaultRoles() { public List<String> getDefaultRoles() {
return defaultRoles; return defaultRoles;
} }

View file

@ -21,21 +21,7 @@ import org.keycloak.models.RoleModel;
import org.keycloak.models.UserFederationMapperModel; import org.keycloak.models.UserFederationMapperModel;
import org.keycloak.models.UserFederationProviderCreationEventImpl; import org.keycloak.models.UserFederationProviderCreationEventImpl;
import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserFederationProviderModel;
import org.keycloak.models.jpa.entities.AuthenticationExecutionEntity; import org.keycloak.models.jpa.entities.*;
import org.keycloak.models.jpa.entities.AuthenticationFlowEntity;
import org.keycloak.models.jpa.entities.AuthenticatorConfigEntity;
import org.keycloak.models.jpa.entities.ClientEntity;
import org.keycloak.models.jpa.entities.ClientTemplateEntity;
import org.keycloak.models.jpa.entities.GroupEntity;
import org.keycloak.models.jpa.entities.IdentityProviderEntity;
import org.keycloak.models.jpa.entities.IdentityProviderMapperEntity;
import org.keycloak.models.jpa.entities.RealmAttributeEntity;
import org.keycloak.models.jpa.entities.RealmEntity;
import org.keycloak.models.jpa.entities.RequiredActionProviderEntity;
import org.keycloak.models.jpa.entities.RequiredCredentialEntity;
import org.keycloak.models.jpa.entities.RoleEntity;
import org.keycloak.models.jpa.entities.UserFederationMapperEntity;
import org.keycloak.models.jpa.entities.UserFederationProviderEntity;
import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.models.utils.KeycloakModelUtils;
import javax.persistence.EntityManager; import javax.persistence.EntityManager;
@ -98,6 +84,26 @@ public class RealmAdapter implements RealmModel {
em.flush(); em.flush();
} }
@Override
public String getDisplayName() {
return getAttribute(RealmAttributes.DISPLAY_NAME);
}
@Override
public void setDisplayName(String displayName) {
setAttribute(RealmAttributes.DISPLAY_NAME, displayName);
}
@Override
public String getDisplayNameHtml() {
return getAttribute(RealmAttributes.DISPLAY_NAME_HTML);
}
@Override
public void setDisplayNameHtml(String displayNameHtml) {
setAttribute(RealmAttributes.DISPLAY_NAME_HTML, displayNameHtml);
}
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
return realm.isEnabled(); return realm.isEnabled();

View file

@ -0,0 +1,12 @@
package org.keycloak.models.jpa.entities;
/**
* @author <a href="mailto:sthorger@redhat.com">Stian Thorgersen</a>
*/
public interface RealmAttributes {
String DISPLAY_NAME = "displayName";
String DISPLAY_NAME_HTML = "displayNameHtml";
}

View file

@ -97,6 +97,28 @@ public class RealmAdapter extends AbstractMongoAdapter<MongoRealmEntity> impleme
updateRealm(); updateRealm();
} }
@Override
public String getDisplayName() {
return realm.getDisplayName();
}
@Override
public void setDisplayName(String displayName) {
realm.setDisplayName(displayName);
updateRealm();
}
@Override
public String getDisplayNameHtml() {
return realm.getDisplayNameHtml();
}
@Override
public void setDisplayNameHtml(String displayNameHtml) {
realm.setDisplayNameHtml(displayNameHtml);
updateRealm();
}
@Override @Override
public boolean isEnabled() { public boolean isEnabled() {
return realm.isEnabled(); return realm.isEnabled();

View file

@ -19,6 +19,7 @@
<properties> <properties>
<product.name>Keycloak</product.name> <product.name>Keycloak</product.name>
<product.name-html>\u003Cstrong\u003EKeycloak\u003C\u002Fstrong\u003E</product.name-html>
<product.version>${project.version}</product.version> <product.version>${project.version}</product.version>
<product.build-time>${timestamp}</product.build-time> <product.build-time>${timestamp}</product.build-time>

View file

@ -2,6 +2,7 @@ package org.keycloak.services.managers;
import org.jboss.logging.Logger; import org.jboss.logging.Logger;
import org.keycloak.Config; import org.keycloak.Config;
import org.keycloak.common.Version;
import org.keycloak.common.enums.SslRequired; import org.keycloak.common.enums.SslRequired;
import org.keycloak.models.AdminRoles; import org.keycloak.models.AdminRoles;
import org.keycloak.models.ClientModel; import org.keycloak.models.ClientModel;
@ -39,6 +40,8 @@ public class ApplianceBootstrap {
manager.setContextPath(contextPath); manager.setContextPath(contextPath);
RealmModel realm = manager.createRealm(adminRealmName, adminRealmName); RealmModel realm = manager.createRealm(adminRealmName, adminRealmName);
realm.setName(adminRealmName); realm.setName(adminRealmName);
realm.setDisplayName(Version.NAME);
realm.setDisplayNameHtml(Version.NAME_HTML);
realm.setEnabled(true); realm.setEnabled(true);
realm.addRequiredCredential(CredentialRepresentation.PASSWORD); realm.addRequiredCredential(CredentialRepresentation.PASSWORD);
realm.setSsoSessionIdleTimeout(1800); realm.setSsoSessionIdleTimeout(1800);

View file

@ -45,7 +45,7 @@ public class OAuthGrantPage extends AbstractPage {
@Override @Override
public boolean isCurrent() { public boolean isCurrent() {
return driver.getTitle().equals("OAuth Grant"); return driver.getTitle().equals("Grant Access");
} }
@Override @Override