forked from keycloak/keycloak
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable verify profile required action by default for new realms
Closes keycloak#25985 Signed-off-by: rmartinc <[email protected]>
- Loading branch information
Showing
22 changed files
with
231 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,7 +235,7 @@ protected void setupDevConfig() { | |
try (KeycloakSession session = sessionFactory.create()) { | ||
session.getTransactionManager().begin(); | ||
if (new ApplianceBootstrap(session).isNoMasterUser()) { | ||
new ApplianceBootstrap(session).createMasterRealmUser("admin", "admin"); | ||
new ApplianceBootstrap(session).createMasterRealmUser("admin", "admin", "admin", "admin", "[email protected]"); | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,6 +149,9 @@ private Process startContainer() throws IOException { | |
|
||
if (!StoreProvider.JPA.equals(StoreProvider.getCurrentProvider())) { | ||
builder.environment().put("KEYCLOAK_ADMIN", "admin"); | ||
builder.environment().put("KEYCLOAK_ADMIN_FIRSTNAME", "admin"); | ||
builder.environment().put("KEYCLOAK_ADMIN_LASTNAME", "admin"); | ||
builder.environment().put("KEYCLOAK_ADMIN_EMAIL", "[email protected]"); | ||
builder.environment().put("KEYCLOAK_ADMIN_PASSWORD", "admin"); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -83,16 +83,25 @@ public static void setupUsers(KeycloakSession session) { | |
realmUser.credentialManager().updateCredential(UserCredentialModel.password("password")); | ||
|
||
UserModel masterUser = session.users().addUser(master, "userAdmin"); | ||
masterUser.setFirstName("userAdmin"); | ||
masterUser.setLastName("userAdmin"); | ||
masterUser.setEmail("[email protected]"); | ||
masterUser.grantRole(masterManageUsers); | ||
masterUser.setEnabled(true); | ||
masterUser.credentialManager().updateCredential(UserCredentialModel.password("password")); | ||
|
||
UserModel masterAdmin = session.users().addUser(master, "masterAdmin"); | ||
masterAdmin.setFirstName("masterAdmin"); | ||
masterAdmin.setLastName("masterAdmin"); | ||
masterAdmin.setEmail("[email protected]"); | ||
masterAdmin.grantRole(masterMasterManageUSers); | ||
masterAdmin.setEnabled(true); | ||
masterAdmin.credentialManager().updateCredential(UserCredentialModel.password("password")); | ||
|
||
UserModel user = session.users().addUser(master, "user"); | ||
user.setFirstName("user"); | ||
user.setLastName("user"); | ||
user.setEmail("[email protected]"); | ||
user.grantRole(masterManageUsers); | ||
user.setEnabled(true); | ||
user.credentialManager().updateCredential(UserCredentialModel.password("password")); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,7 +142,12 @@ public void testImpersonateByMasterAdmin() { | |
@Test | ||
public void testImpersonateByMasterImpersonator() { | ||
String userId; | ||
try (Response response = adminClient.realm("master").users().create(UserBuilder.create().username("master-impersonator").build())) { | ||
try (Response response = adminClient.realm("master").users().create( | ||
UserBuilder.create().username("master-impersonator") | ||
.firstName("master-impersonator") | ||
.lastName("master-impersonator") | ||
.email("[email protected]") | ||
.build())) { | ||
userId = ApiUtil.getCreatedId(response); | ||
} | ||
|
||
|
@@ -195,7 +200,12 @@ public void testImpersonationFailsForDisabledUser() { | |
@Test | ||
public void testImpersonateByMastertBadImpersonator() { | ||
String userId; | ||
try (Response response = adminClient.realm("master").users().create(UserBuilder.create().username("master-bad-impersonator").build())) { | ||
try (Response response = adminClient.realm("master").users().create( | ||
UserBuilder.create().username("master-bad-impersonator") | ||
.firstName("master-bad-impersonator") | ||
.lastName("master-bad-impersonator") | ||
.email("[email protected]") | ||
.build())) { | ||
userId = ApiUtil.getCreatedId(response); | ||
} | ||
adminClient.realm("master").users().get(userId).resetPassword(CredentialBuilder.create().password("password").build()); | ||
|
Oops, something went wrong.