KEYCLOAK-15 Customize login and registration forms
This commit is contained in:
1 parent
38b7dcdf7d
commit
97897cab1d
198 files changed
+4893
-2754
No files matched your search
@@ -90,7 +90,32 @@
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-forms</artifactId>
|
||||
<artifactId>keycloak-forms-common-freemarker</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-forms-common-themes</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-account-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-account-freemarker</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-login-api</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.keycloak</groupId>
|
||||
<artifactId>keycloak-login-freemarker</artifactId>
|
||||
<version>${project.version}</version>
|
||||
</dependency>
|
||||
|
||||
|
||||
@@ -37,6 +37,7 @@ import io.undertow.servlet.api.ServletInfo;
|
||||
import org.jboss.resteasy.logging.Logger;
|
||||
import org.jboss.resteasy.plugins.server.undertow.UndertowJaxrsServer;
|
||||
import org.jboss.resteasy.spi.ResteasyDeployment;
|
||||
import org.keycloak.theme.DefaultLoginThemeProvider;
|
||||
import org.keycloak.services.tmp.TmpAdminRedirectServlet;
|
||||
import org.keycloak.util.JsonSerialization;
|
||||
import org.keycloak.models.Constants;
|
||||
@@ -136,6 +137,11 @@ public class KeycloakServer {
|
||||
throw new RuntimeException("Invalid resources directory");
|
||||
}
|
||||
|
||||
if (!System.getProperties().containsKey("keycloak.theme.dir")) {
|
||||
System.setProperty(DefaultLoginThemeProvider.class.getName() + ".disabled", "");
|
||||
System.setProperty("keycloak.theme.dir", file(dir.getAbsolutePath(), "forms", "common-themes", "src", "main", "resources", "theme").getAbsolutePath());
|
||||
}
|
||||
|
||||
config.setResourcesHome(dir.getAbsolutePath());
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -87,7 +87,7 @@ public class ResetPasswordTest {
|
||||
|
||||
resetPasswordPage.assertCurrent();
|
||||
|
||||
Assert.assertEquals("Success!", resetPasswordPage.getMessage());
|
||||
Assert.assertEquals("You should receive an email shortly with further instructions.", resetPasswordPage.getMessage());
|
||||
|
||||
Assert.assertEquals(1, greenMail.getReceivedMessages().length);
|
||||
|
||||
@@ -146,7 +146,7 @@ public class ResetPasswordTest {
|
||||
|
||||
resetPasswordPage.assertCurrent();
|
||||
|
||||
Assert.assertEquals("Success!", resetPasswordPage.getMessage());
|
||||
Assert.assertEquals("You should receive an email shortly with further instructions.", resetPasswordPage.getMessage());
|
||||
|
||||
Assert.assertEquals(1, greenMail.getReceivedMessages().length);
|
||||
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class AccountPasswordPage extends AbstractAccountPage {
|
||||
}
|
||||
|
||||
public boolean isCurrent() {
|
||||
return driver.getPageSource().contains("Change Password");
|
||||
return driver.getTitle().contains("Account Management") && driver.getCurrentUrl().endsWith("/account/password");
|
||||
}
|
||||
|
||||
public void open() {
|
||||
|
||||
+1
-1
@@ -54,7 +54,7 @@ public class AccountTotpPage extends AbstractAccountPage {
|
||||
}
|
||||
|
||||
public boolean isCurrent() {
|
||||
return driver.getTitle().contains("Edit Account - Google Authenticator");
|
||||
return driver.getTitle().contains("Account Management") && driver.getCurrentUrl().endsWith("/account/totp");
|
||||
}
|
||||
|
||||
public void open() {
|
||||
|
||||
+1
-1
@@ -75,7 +75,7 @@ public class AccountUpdateProfilePage extends AbstractAccountPage {
|
||||
}
|
||||
|
||||
public boolean isCurrent() {
|
||||
return driver.getPageSource().contains("Edit Account");
|
||||
return driver.getTitle().contains("Account Management") && driver.getPageSource().contains("Edit Account");
|
||||
}
|
||||
|
||||
public void open() {
|
||||
|
||||
@@ -59,7 +59,7 @@ public class LoginPage extends AbstractPage {
|
||||
@FindBy(linkText = "Username")
|
||||
private WebElement recoverUsernameLink;
|
||||
|
||||
@FindBy(id = "loginError")
|
||||
@FindBy(className = "error")
|
||||
private WebElement loginErrorMessage;
|
||||
|
||||
public void login(String username, String password) {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class LoginTotpPage extends AbstractPage {
|
||||
@FindBy(css = "input[type=\"submit\"]")
|
||||
private WebElement submitButton;
|
||||
|
||||
@FindBy(id = "loginError")
|
||||
@FindBy(className = "error")
|
||||
private WebElement loginErrorMessage;
|
||||
|
||||
public void login(String totp) {
|
||||
|
||||
+1
-1
@@ -41,7 +41,7 @@ public class LoginUpdateProfilePage extends AbstractPage {
|
||||
@FindBy(css = "input[type=\"submit\"]")
|
||||
private WebElement submitButton;
|
||||
|
||||
@FindBy(id = "loginError")
|
||||
@FindBy(className = "error")
|
||||
private WebElement loginErrorMessage;
|
||||
|
||||
public void update(String firstName, String lastName, String email) {
|
||||
|
||||
@@ -50,7 +50,7 @@ public class RegisterPage extends AbstractPage {
|
||||
@FindBy(css = "input[type=\"submit\"]")
|
||||
private WebElement submitButton;
|
||||
|
||||
@FindBy(id = "loginError")
|
||||
@FindBy(className = "error")
|
||||
private WebElement loginErrorMessage;
|
||||
|
||||
public void register(String firstName, String lastName, String email, String username, String password, String passwordConfirm) {
|
||||
|
||||
Reference in new issue
Block a user