diff --git a/docbook/reference/en/en-US/modules/MigrationFromOlderVersions.xml b/docbook/reference/en/en-US/modules/MigrationFromOlderVersions.xml index a49d432c41..10027b90ac 100755 --- a/docbook/reference/en/en-US/modules/MigrationFromOlderVersions.xml +++ b/docbook/reference/en/en-US/modules/MigrationFromOlderVersions.xml @@ -104,6 +104,14 @@ impacts on performance. + + Contact details removed from registration and account management + + In the default theme we have now removed the contact details from the registration page and account management. The admin console now lists + all the users attributes, not just contact specific attributes. The admin console also has the ability to add/remove attributes to a user. + If you want to add contact details, please refer to the address theme included in the examples. + +
Migrating to 1.3.0.Final diff --git a/examples/themes/README.md b/examples/themes/README.md index 69c922b598..ba47b3c47a 100644 --- a/examples/themes/README.md +++ b/examples/themes/README.md @@ -26,6 +26,14 @@ Then open $KEYCLOAK_HOME/standalone/configuration/keycloak-server.json and regis } +Address Theme +------------------- + +Example theme that adds address fields to registration page, account management and admin console. To enable the theme open the admin console, select your realm, click on `Theme`. In the dropdown for `Login Theme` and `Account Theme` select `address`. Click `Save` and login to the realm to see the new theme in action. + +One thing to note is that to change the admin console for the master admin console (`/auth/admin`) you need to change the theme for the master realm. Changing the admin console theme for any other realms will only change the admin console for that specific realm (for example `/auth/admin/myrealm/console`). + + Sunrise Login Theme ------------------- diff --git a/examples/themes/src/main/resources/META-INF/keycloak-themes.json b/examples/themes/src/main/resources/META-INF/keycloak-themes.json index 12ee694ecd..aafb6e883c 100644 --- a/examples/themes/src/main/resources/META-INF/keycloak-themes.json +++ b/examples/themes/src/main/resources/META-INF/keycloak-themes.json @@ -1,5 +1,8 @@ { "themes": [{ + "name" : "address", + "types": [ "admin", "account", "login" ] + }, { "name" : "logo-example", "types": [ "admin", "account", "login", "welcome" ] }, { diff --git a/examples/themes/src/main/resources/theme/address/account/account.ftl b/examples/themes/src/main/resources/theme/address/account/account.ftl new file mode 100755 index 0000000000..d2a6af16e0 --- /dev/null +++ b/examples/themes/src/main/resources/theme/address/account/account.ftl @@ -0,0 +1,114 @@ +<#import "template.ftl" as layout> +<@layout.mainLayout active='account' bodyClass='user'; section> + +
+
+

${msg("editAccountHtmlTtile")}

+
+
+ * ${msg("requiredFields")} +
+
+ +
+ + + +
+
+ <#if realm.editUsernameAllowed>* +
+ +
+ disabled="disabled" value="${(account.username!'')?html}"/> +
+
+ +
+
+ * +
+ +
+ +
+
+ +
+
+ * +
+ +
+ +
+
+ +
+
+ * +
+ +
+ +
+
+ +
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+ + + + + \ No newline at end of file diff --git a/examples/themes/src/main/resources/theme/address/account/theme.properties b/examples/themes/src/main/resources/theme/address/account/theme.properties new file mode 100644 index 0000000000..512d63324a --- /dev/null +++ b/examples/themes/src/main/resources/theme/address/account/theme.properties @@ -0,0 +1 @@ +parent=keycloak \ No newline at end of file diff --git a/examples/themes/src/main/resources/theme/address/admin/resources/partials/user-attributes.html b/examples/themes/src/main/resources/theme/address/admin/resources/partials/user-attributes.html new file mode 100755 index 0000000000..8547961846 --- /dev/null +++ b/examples/themes/src/main/resources/theme/address/admin/resources/partials/user-attributes.html @@ -0,0 +1,55 @@ +
+ + + + +
+
+ +
+ +
+ Street address. +
+
+ +
+ +
+ City or locality. +
+
+ +
+ +
+ State, province, prefecture, or region. +
+
+ +
+ +
+ Zip code or postal code. +
+
+ +
+ +
+ Country name. +
+ +
+
+ + +
+
+
+
+ + diff --git a/examples/themes/src/main/resources/theme/address/admin/theme.properties b/examples/themes/src/main/resources/theme/address/admin/theme.properties new file mode 100644 index 0000000000..512d63324a --- /dev/null +++ b/examples/themes/src/main/resources/theme/address/admin/theme.properties @@ -0,0 +1 @@ +parent=keycloak \ No newline at end of file diff --git a/examples/themes/src/main/resources/theme/address/login/login-update-profile.ftl b/examples/themes/src/main/resources/theme/address/login/login-update-profile.ftl new file mode 100755 index 0000000000..8be620d18f --- /dev/null +++ b/examples/themes/src/main/resources/theme/address/login/login-update-profile.ftl @@ -0,0 +1,95 @@ +<#import "template.ftl" as layout> +<@layout.registrationLayout; section> + <#if section = "title"> + ${msg("loginProfileTitle")} + <#elseif section = "header"> + ${msg("loginProfileTitle")} + <#elseif section = "form"> +
+
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+ + +
+
+
+
+
+ +
+ +
+
+
+ + \ No newline at end of file diff --git a/examples/themes/src/main/resources/theme/address/login/register.ftl b/examples/themes/src/main/resources/theme/address/login/register.ftl new file mode 100755 index 0000000000..3247305cf9 --- /dev/null +++ b/examples/themes/src/main/resources/theme/address/login/register.ftl @@ -0,0 +1,131 @@ +<#import "template.ftl" as layout> +<@layout.registrationLayout; section> + <#if section = "title"> + ${msg("registerWithTitle",(realm.name!''))} + <#elseif section = "header"> + ${msg("registerWithTitleHtml",(realm.name!''))} + <#elseif section = "form"> +
+ <#if !realm.registrationEmailAsUsername> +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ + <#if passwordRequired> +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+
+
+ +
+ +
+ +
+
+ <#if recaptchaRequired??> +
+
+
+
+
+ + +
+ + +
+ +
+
+
+ + \ No newline at end of file diff --git a/examples/themes/src/main/resources/theme/address/login/theme.properties b/examples/themes/src/main/resources/theme/address/login/theme.properties new file mode 100644 index 0000000000..512d63324a --- /dev/null +++ b/examples/themes/src/main/resources/theme/address/login/theme.properties @@ -0,0 +1 @@ +parent=keycloak \ No newline at end of file diff --git a/forms/common-themes/src/main/resources/theme/base/account/account.ftl b/forms/common-themes/src/main/resources/theme/base/account/account.ftl index d2a6af16e0..60a21b5e14 100755 --- a/forms/common-themes/src/main/resources/theme/base/account/account.ftl +++ b/forms/common-themes/src/main/resources/theme/base/account/account.ftl @@ -54,52 +54,6 @@ -
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js index 2a37bc0c63..d0fc4024f8 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/app.js @@ -345,6 +345,18 @@ module.config([ '$routeProvider', function($routeProvider) { }, controller : 'UserDetailCtrl' }) + .when('/realms/:realm/users/:user/user-attributes', { + templateUrl : resourceUrl + '/partials/user-attributes.html', + resolve : { + realm : function(RealmLoader) { + return RealmLoader(); + }, + user : function(UserLoader) { + return UserLoader(); + } + }, + controller : 'UserDetailCtrl' + }) .when('/realms/:realm/users/:user/user-credentials', { templateUrl : resourceUrl + '/partials/user-credentials.html', resolve : { diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js index 802b202528..b693827a21 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/js/controllers/users.js @@ -450,6 +450,15 @@ module.controller('UserDetailCtrl', function($scope, realm, user, BruteForceUser $scope.cancel = function() { $location.url("/realms/" + realm.realm + "/users"); }; + + $scope.addAttribute = function() { + $scope.user.attributes[$scope.newAttribute.key] = $scope.newAttribute.value; + delete $scope.newAttribute; + } + + $scope.removeAttribute = function(key) { + delete $scope.user.attributes[key]; + } }); module.controller('UserCredentialsCtrl', function($scope, realm, user, User, UserCredentials, Notifications, Dialog) { diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-attribute-entry.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-attribute-entry.html deleted file mode 100755 index 373c91c13d..0000000000 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-attribute-entry.html +++ /dev/null @@ -1,38 +0,0 @@ -
- Contact Information Expand this section to configure user's contact information. -
- -
- -
- Street address. -
-
- -
- -
- City or locality. -
-
- -
- -
- State, province, prefecture, or region. -
-
- -
- -
- Zip code or postal code. -
-
- -
- -
- Country name. -
-
\ No newline at end of file diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-attributes.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-attributes.html new file mode 100755 index 0000000000..542431dcf6 --- /dev/null +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-attributes.html @@ -0,0 +1,45 @@ +
+ + + + +
+ + + + + + + + + + + + + + + + + + + + +
KeyValueActions
{{key}} + +
+ +
+ +
+
+ + +
+
+
+
+ + diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-detail.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-detail.html index 006f83f98a..feedea5a4c 100755 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-detail.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/partials/user-detail.html @@ -123,8 +123,6 @@ -
-
diff --git a/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user.html b/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user.html index e090fca31e..edc3a66481 100644 --- a/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user.html +++ b/forms/common-themes/src/main/resources/theme/base/admin/resources/templates/kc-tabs-user.html @@ -6,7 +6,8 @@

Add User

- -
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
diff --git a/forms/common-themes/src/main/resources/theme/base/login/register.ftl b/forms/common-themes/src/main/resources/theme/base/login/register.ftl index 3247305cf9..d1593daedf 100755 --- a/forms/common-themes/src/main/resources/theme/base/login/register.ftl +++ b/forms/common-themes/src/main/resources/theme/base/login/register.ftl @@ -62,51 +62,7 @@
-
-
- -
-
- -
-
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
-
-
- -
- -
- -
-
<#if recaptchaRequired??>
diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/account/AccountTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/account/AccountTest.java index 12ec02905d..95d644eb82 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/account/AccountTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/account/AccountTest.java @@ -562,7 +562,7 @@ public class AccountTest { loginPage.open(); loginPage.clickRegister(); - registerPage.register("view", "log", "view-log@localhost", "view-log", "password", "password", null); + registerPage.register("view", "log", "view-log@localhost", "view-log", "password", "password"); expectedEvents.add(events.poll()); expectedEvents.add(events.poll()); @@ -609,7 +609,7 @@ public class AccountTest { loginPage.open(); loginPage.clickRegister(); - registerPage.register("view", "sessions", "view-sessions@localhost", "view-sessions", "password", "password", null); + registerPage.register("view", "sessions", "view-sessions@localhost", "view-sessions", "password", "password"); Event registerEvent = events.expectRegister("view-sessions", "view-sessions@localhost").assertEvent(); String userId = registerEvent.getUserId(); diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionEmailVerificationTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionEmailVerificationTest.java index 38760b9dc2..a9c0c58373 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionEmailVerificationTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionEmailVerificationTest.java @@ -145,7 +145,7 @@ public class RequiredActionEmailVerificationTest { public void verifyEmailRegister() throws IOException, MessagingException { loginPage.open(); loginPage.clickRegister(); - registerPage.register("firstName", "lastName", "email@mail.com", "verifyEmail", "password", "password", null); + registerPage.register("firstName", "lastName", "email@mail.com", "verifyEmail", "password", "password"); String userId = events.expectRegister("verifyEmail", "email@mail.com").assertEvent().getUserId(); diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionMultipleActionsTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionMultipleActionsTest.java index 341a440204..4d16a1b1dc 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionMultipleActionsTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionMultipleActionsTest.java @@ -121,7 +121,7 @@ public class RequiredActionMultipleActionsTest { } public String updateProfile(String sessionId) { - updateProfilePage.update("New first", "New last", "new@email.com", null); + updateProfilePage.update("New first", "New last", "new@email.com"); AssertEvents.ExpectedEvent expectedEvent = events.expectRequiredAction(EventType.UPDATE_PROFILE); if (sessionId != null) { diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java index a4206aadd0..dab94288d4 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionTotpSetupTest.java @@ -25,21 +25,16 @@ import org.junit.Assert; import org.junit.ClassRule; import org.junit.Rule; import org.junit.Test; -import org.keycloak.constants.KerberosConstants; import org.keycloak.events.Details; import org.keycloak.events.Event; import org.keycloak.events.EventType; -import org.keycloak.models.ClientModel; import org.keycloak.models.OTPPolicy; -import org.keycloak.models.ProtocolMapperModel; import org.keycloak.models.RealmModel; import org.keycloak.models.RequiredActionProviderModel; -import org.keycloak.models.RoleModel; import org.keycloak.models.UserCredentialModel; import org.keycloak.models.UserModel; import org.keycloak.models.utils.HmacOTP; import org.keycloak.models.utils.TimeBasedOTP; -import org.keycloak.protocol.oidc.mappers.UserSessionNoteMapper; import org.keycloak.representations.idm.CredentialRepresentation; import org.keycloak.services.managers.RealmManager; import org.keycloak.testsuite.AssertEvents; @@ -117,7 +112,7 @@ public class RequiredActionTotpSetupTest { public void setupTotpRegister() { loginPage.open(); loginPage.clickRegister(); - registerPage.register("firstName", "lastName", "email@mail.com", "setupTotp", "password", "password", null); + registerPage.register("firstName", "lastName", "email@mail.com", "setupTotp", "password", "password"); String userId = events.expectRegister("setupTotp", "email@mail.com").assertEvent().getUserId(); @@ -170,7 +165,7 @@ public class RequiredActionTotpSetupTest { // Register new user loginPage.open(); loginPage.clickRegister(); - registerPage.register("firstName2", "lastName2", "email2@mail.com", "setupTotp2", "password2", "password2", null); + registerPage.register("firstName2", "lastName2", "email2@mail.com", "setupTotp2", "password2", "password2"); String userId = events.expectRegister("setupTotp2", "email2@mail.com").assertEvent().getUserId(); diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionUpdateProfileTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionUpdateProfileTest.java index b61ee176ba..a7c84a0723 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionUpdateProfileTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/actions/RequiredActionUpdateProfileTest.java @@ -87,7 +87,7 @@ public class RequiredActionUpdateProfileTest { updateProfilePage.assertCurrent(); - updateProfilePage.update("New first", "New last", "new@email.com", "mystreet"); + updateProfilePage.update("New first", "New last", "new@email.com"); String sessionId = events.expectRequiredAction(EventType.UPDATE_PROFILE).assertEvent().getSessionId(); events.expectRequiredAction(EventType.UPDATE_EMAIL).session(sessionId).detail(Details.PREVIOUS_EMAIL, "test-user@localhost").detail(Details.UPDATED_EMAIL, "new@email.com").assertEvent(); @@ -101,7 +101,6 @@ public class RequiredActionUpdateProfileTest { Assert.assertEquals("New first", user.getFirstName()); Assert.assertEquals("New last", user.getLastName()); Assert.assertEquals("new@email.com", user.getEmail()); - Assert.assertEquals("mystreet", user.getAttributesAsListValues().get("street").get(0)); } @Test @@ -112,7 +111,7 @@ public class RequiredActionUpdateProfileTest { updateProfilePage.assertCurrent(); - updateProfilePage.update("", "New last", "new@email.com", "mystreet"); + updateProfilePage.update("", "New last", "new@email.com"); updateProfilePage.assertCurrent(); @@ -120,7 +119,6 @@ public class RequiredActionUpdateProfileTest { Assert.assertEquals("", updateProfilePage.getFirstName()); Assert.assertEquals("New last", updateProfilePage.getLastName()); Assert.assertEquals("new@email.com", updateProfilePage.getEmail()); - Assert.assertEquals("mystreet", updateProfilePage.getAttributeStreet()); Assert.assertEquals("Please specify first name.", updateProfilePage.getError()); @@ -135,7 +133,7 @@ public class RequiredActionUpdateProfileTest { updateProfilePage.assertCurrent(); - updateProfilePage.update("New first", "", "new@email.com", null); + updateProfilePage.update("New first", "", "new@email.com"); updateProfilePage.assertCurrent(); @@ -143,7 +141,6 @@ public class RequiredActionUpdateProfileTest { Assert.assertEquals("New first", updateProfilePage.getFirstName()); Assert.assertEquals("", updateProfilePage.getLastName()); Assert.assertEquals("new@email.com", updateProfilePage.getEmail()); - Assert.assertEquals("", updateProfilePage.getAttributeStreet()); Assert.assertEquals("Please specify last name.", updateProfilePage.getError()); @@ -158,7 +155,7 @@ public class RequiredActionUpdateProfileTest { updateProfilePage.assertCurrent(); - updateProfilePage.update("New first", "New last", "", "mystreet"); + updateProfilePage.update("New first", "New last", ""); updateProfilePage.assertCurrent(); @@ -166,7 +163,6 @@ public class RequiredActionUpdateProfileTest { Assert.assertEquals("New first", updateProfilePage.getFirstName()); Assert.assertEquals("New last", updateProfilePage.getLastName()); Assert.assertEquals("", updateProfilePage.getEmail()); - Assert.assertEquals("mystreet", updateProfilePage.getAttributeStreet()); Assert.assertEquals("Please specify email.", updateProfilePage.getError()); @@ -181,7 +177,7 @@ public class RequiredActionUpdateProfileTest { updateProfilePage.assertCurrent(); - updateProfilePage.update("New first", "New last", "invalidemail", null); + updateProfilePage.update("New first", "New last", "invalidemail"); updateProfilePage.assertCurrent(); @@ -189,7 +185,6 @@ public class RequiredActionUpdateProfileTest { Assert.assertEquals("New first", updateProfilePage.getFirstName()); Assert.assertEquals("New last", updateProfilePage.getLastName()); Assert.assertEquals("invalidemail", updateProfilePage.getEmail()); - Assert.assertEquals("", updateProfilePage.getAttributeStreet()); Assert.assertEquals("Invalid email address.", updateProfilePage.getError()); @@ -204,7 +199,7 @@ public class RequiredActionUpdateProfileTest { updateProfilePage.assertCurrent(); - updateProfilePage.update("New first", "New last", "keycloak-user@localhost", null); + updateProfilePage.update("New first", "New last", "keycloak-user@localhost"); updateProfilePage.assertCurrent(); diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderTest.java index e3dabc8f42..8ce5c7ce6b 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/broker/AbstractIdentityProviderTest.java @@ -451,7 +451,7 @@ public abstract class AbstractIdentityProviderTest { doAfterProviderAuthentication(); this.updateProfilePage.assertCurrent(); - this.updateProfilePage.update("Test", "User", "psilva@redhat.com", null); + this.updateProfilePage.update("Test", "User", "psilva@redhat.com"); WebElement element = this.driver.findElement(By.className("kc-feedback-text")); @@ -460,7 +460,7 @@ public abstract class AbstractIdentityProviderTest { assertEquals("Email already exists.", element.getText()); this.updateProfilePage.assertCurrent(); - this.updateProfilePage.update("Test", "User", "test-user@redhat.com", null); + this.updateProfilePage.update("Test", "User", "test-user@redhat.com"); assertTrue(this.driver.getCurrentUrl().startsWith("http://localhost:8081/test-app")); @@ -724,7 +724,7 @@ public abstract class AbstractIdentityProviderTest { // update profile this.updateProfilePage.assertCurrent(); - this.updateProfilePage.update(userFirstName, userLastName, userEmail, null); + this.updateProfilePage.update(userFirstName, userLastName, userEmail); } } diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/FederationProvidersIntegrationTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/FederationProvidersIntegrationTest.java index 943adaff47..3a860115c7 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/FederationProvidersIntegrationTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/federation/FederationProvidersIntegrationTest.java @@ -245,7 +245,6 @@ public class FederationProvidersIntegrationTest { Assert.assertEquals("John", profilePage.getFirstName()); Assert.assertEquals("Doe", profilePage.getLastName()); Assert.assertEquals("john@email.org", profilePage.getEmail()); - Assert.assertEquals("1234", profilePage.getPostalCode()); } @Test @@ -296,12 +295,12 @@ public class FederationProvidersIntegrationTest { registerPage.assertCurrent(); // check existing username - registerPage.register("firstName", "lastName", "email@mail.cz", "existing", "Password1", "Password1", null); + registerPage.register("firstName", "lastName", "email@mail.cz", "existing", "Password1", "Password1"); registerPage.assertCurrent(); Assert.assertEquals("Username already exists.", registerPage.getError()); // Check existing email - registerPage.register("firstName", "lastName", "existing@email.org", "nonExisting", "Password1", "Password1", null); + registerPage.register("firstName", "lastName", "existing@email.org", "nonExisting", "Password1", "Password1"); registerPage.assertCurrent(); Assert.assertEquals("Email already exists.", registerPage.getError()); } @@ -312,7 +311,7 @@ public class FederationProvidersIntegrationTest { loginPage.clickRegister(); registerPage.assertCurrent(); - registerPage.register("firstName", "lastName", "email2@check.cz", "registerUserSuccess2", "Password1", "Password1", null); + registerPage.register("firstName", "lastName", "email2@check.cz", "registerUserSuccess2", "Password1", "Password1"); Assert.assertEquals(AppPage.RequestType.AUTH_RESPONSE, appPage.getRequestType()); KeycloakSession session = keycloakRule.startSession(); diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java index 63a754eb6f..9c2852e59d 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/RegisterTest.java @@ -77,7 +77,7 @@ public class RegisterTest { loginPage.clickRegister(); registerPage.assertCurrent(); - registerPage.register("firstName", "lastName", "registerExistingUser@email", "test-user@localhost", "password", "password", "mystreet"); + registerPage.register("firstName", "lastName", "registerExistingUser@email", "test-user@localhost", "password", "password"); registerPage.assertCurrent(); Assert.assertEquals("Username already exists.", registerPage.getError()); @@ -89,7 +89,6 @@ public class RegisterTest { Assert.assertEquals("", registerPage.getUsername()); Assert.assertEquals("", registerPage.getPassword()); Assert.assertEquals("", registerPage.getPasswordConfirm()); - Assert.assertEquals("mystreet", registerPage.getAttributeStreet()); events.expectRegister("test-user@localhost", "registerExistingUser@email") .removeDetail(Details.EMAIL) @@ -102,7 +101,7 @@ public class RegisterTest { loginPage.clickRegister(); registerPage.assertCurrent(); - registerPage.register("firstName", "lastName", "registerUserInvalidPasswordConfirm@email", "registerUserInvalidPasswordConfirm", "password", "invalid", null); + registerPage.register("firstName", "lastName", "registerUserInvalidPasswordConfirm@email", "registerUserInvalidPasswordConfirm", "password", "invalid"); registerPage.assertCurrent(); Assert.assertEquals("Password confirmation doesn't match.", registerPage.getError()); @@ -114,7 +113,6 @@ public class RegisterTest { Assert.assertEquals("registerUserInvalidPasswordConfirm", registerPage.getUsername()); Assert.assertEquals("", registerPage.getPassword()); Assert.assertEquals("", registerPage.getPasswordConfirm()); - Assert.assertEquals("", registerPage.getAttributeStreet()); events.expectRegister("registerUserInvalidPasswordConfirm", "registerUserInvalidPasswordConfirm@email") .removeDetail(Details.USERNAME) @@ -128,7 +126,7 @@ public class RegisterTest { loginPage.clickRegister(); registerPage.assertCurrent(); - registerPage.register("firstName", "lastName", "registerUserMissingPassword@email", "registerUserMissingPassword", null, null, null); + registerPage.register("firstName", "lastName", "registerUserMissingPassword@email", "registerUserMissingPassword", null, null); registerPage.assertCurrent(); Assert.assertEquals("Please specify password.", registerPage.getError()); @@ -153,7 +151,7 @@ public class RegisterTest { loginPage.clickRegister(); registerPage.assertCurrent(); - registerPage.register("firstName", "lastName", "registerPasswordPolicy@email", "registerPasswordPolicy", "pass", "pass", null); + registerPage.register("firstName", "lastName", "registerPasswordPolicy@email", "registerPasswordPolicy", "pass", "pass"); registerPage.assertCurrent(); Assert.assertEquals("Invalid password: minimum length 8.", registerPage.getError()); @@ -163,7 +161,7 @@ public class RegisterTest { .removeDetail(Details.EMAIL) .user((String) null).error("invalid_registration").assertEvent(); - registerPage.register("firstName", "lastName", "registerPasswordPolicy@email", "registerPasswordPolicy", "password", "password", null); + registerPage.register("firstName", "lastName", "registerPasswordPolicy@email", "registerPasswordPolicy", "password", "password"); Assert.assertEquals(RequestType.AUTH_RESPONSE, appPage.getRequestType()); String userId = events.expectRegister("registerPasswordPolicy", "registerPasswordPolicy@email").assertEvent().getUserId(); @@ -185,7 +183,7 @@ public class RegisterTest { loginPage.clickRegister(); registerPage.assertCurrent(); - registerPage.register("firstName", "lastName", "registerUserMissingUsername@email", null, "password", "password", null); + registerPage.register("firstName", "lastName", "registerUserMissingUsername@email", null, "password", "password"); registerPage.assertCurrent(); Assert.assertEquals("Please specify username.", registerPage.getError()); @@ -202,14 +200,14 @@ public class RegisterTest { loginPage.clickRegister(); registerPage.assertCurrent(); - registerPage.register("firstName", "lastName", null, "registerUserMissingEmail", "password", "password", null); + registerPage.register("firstName", "lastName", null, "registerUserMissingEmail", "password", "password"); registerPage.assertCurrent(); Assert.assertEquals("Please specify email.", registerPage.getError()); events.expectRegister("registerUserMissingEmail", null) .removeDetail("email") .error("invalid_registration").assertEvent(); - registerPage.register("firstName", "lastName", "registerUserInvalidEmailemail", "registerUserInvalidEmail", "password", "password", null); + registerPage.register("firstName", "lastName", "registerUserInvalidEmailemail", "registerUserInvalidEmail", "password", "password"); registerPage.assertCurrent(); Assert.assertEquals("Invalid email address.", registerPage.getError()); events.expectRegister("registerUserInvalidEmail", "registerUserInvalidEmailemail") @@ -222,7 +220,7 @@ public class RegisterTest { loginPage.clickRegister(); registerPage.assertCurrent(); - registerPage.register("firstName", "lastName", "registerUserSuccess@email", "registerUserSuccess", "password", "password", "myStreet"); + registerPage.register("firstName", "lastName", "registerUserSuccess@email", "registerUserSuccess", "password", "password"); Assert.assertEquals(RequestType.AUTH_RESPONSE, appPage.getRequestType()); @@ -239,7 +237,6 @@ public class RegisterTest { Assert.assertEquals("registerusersuccess@email", user.getEmail()); Assert.assertEquals("firstName", user.getFirstName()); Assert.assertEquals("lastName", user.getLastName()); - Assert.assertEquals("myStreet", user.getAttribute("street").get(0)); } protected UserModel getUser(String userId) { diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountUpdateProfilePage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountUpdateProfilePage.java index 18bc795701..c013345048 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountUpdateProfilePage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/AccountUpdateProfilePage.java @@ -47,9 +47,6 @@ public class AccountUpdateProfilePage extends AbstractAccountPage { @FindBy(id = "email") private WebElement emailInput; - @FindBy(id = "user.attributes.postal_code") - private WebElement postalCodeInput; - @FindBy(id = "referrer") private WebElement backToApplicationLink; @@ -107,10 +104,6 @@ public class AccountUpdateProfilePage extends AbstractAccountPage { return lastNameInput.getAttribute("value"); } - public String getPostalCode() { - return postalCodeInput.getAttribute("value"); - } - public String getEmail() { return emailInput.getAttribute("value"); } diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginUpdateProfilePage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginUpdateProfilePage.java index 809150f6f9..d67862c792 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginUpdateProfilePage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/LoginUpdateProfilePage.java @@ -38,25 +38,19 @@ public class LoginUpdateProfilePage extends AbstractPage { @FindBy(id = "email") private WebElement emailInput; - @FindBy(id = "user.attributes.street") - private WebElement attributeStreetInput; - @FindBy(css = "input[type=\"submit\"]") private WebElement submitButton; @FindBy(className = "feedback-error") private WebElement loginErrorMessage; - public void update(String firstName, String lastName, String email, String attributeStreet) { + public void update(String firstName, String lastName, String email) { firstNameInput.clear(); firstNameInput.sendKeys(firstName); lastNameInput.clear(); lastNameInput.sendKeys(lastName); emailInput.clear(); emailInput.sendKeys(email); - attributeStreetInput.clear(); - if (attributeStreet != null) - attributeStreetInput.sendKeys(attributeStreet); submitButton.click(); } @@ -76,10 +70,6 @@ public class LoginUpdateProfilePage extends AbstractPage { return emailInput.getAttribute("value"); } - public String getAttributeStreet() { - return attributeStreetInput.getAttribute("value"); - } - public boolean isCurrent() { return driver.getTitle().equals("Update Account Information"); } diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/RegisterPage.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/RegisterPage.java index 0892b0fb72..456d0a8205 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/RegisterPage.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/pages/RegisterPage.java @@ -50,9 +50,6 @@ public class RegisterPage extends AbstractPage { @FindBy(id = "password-confirm") private WebElement passwordConfirmInput; - - @FindBy(id = "user.attributes.street") - private WebElement attributeStreetInput; @FindBy(css = "input[type=\"submit\"]") private WebElement submitButton; @@ -60,7 +57,7 @@ public class RegisterPage extends AbstractPage { @FindBy(className = "feedback-error") private WebElement loginErrorMessage; - public void register(String firstName, String lastName, String email, String username, String password, String passwordConfirm, String attributeStreet) { + public void register(String firstName, String lastName, String email, String username, String password, String passwordConfirm) { firstNameInput.clear(); if (firstName != null) { firstNameInput.sendKeys(firstName); @@ -91,11 +88,6 @@ public class RegisterPage extends AbstractPage { passwordConfirmInput.sendKeys(passwordConfirm); } - attributeStreetInput.clear(); - if (attributeStreet != null) { - attributeStreetInput.sendKeys(attributeStreet); - } - submitButton.click(); } @@ -163,10 +155,6 @@ public class RegisterPage extends AbstractPage { return passwordConfirmInput.getAttribute("value"); } - public String getAttributeStreet() { - return attributeStreetInput.getAttribute("value"); - } - public boolean isCurrent() { return driver.getTitle().equals("Register with test"); }