Skip to content

Commit

Permalink
MGRTENANT-27: enable option in Keycloak making username editable
Browse files Browse the repository at this point in the history
  • Loading branch information
yaroslav-epam committed Oct 1, 2024
1 parent 6598afe commit 98abd73
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ private RealmRepresentation toRealmRepresentation(Tenant tenant) {
realm.setEnabled(true);
realm.setDuplicateEmailsAllowed(TRUE);
realm.setLoginWithEmailAllowed(FALSE);
realm.setEditUsernameAllowed(TRUE);
realm.setRequiredActions(getAuthenticationRequiredActions());
realm.setComponents(getRealmComponentsConfiguration());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ public class Realm implements Serializable {
@JsonProperty("loginWithEmailAllowed")
private Boolean loginWithEmailAllowed;

@JsonProperty("editUsernameAllowed")
private Boolean editUsernameAllowed;

@JsonProperty("requiredActions")
private List<Map<String, Object>> requiredActions;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ private static RealmRepresentation keycloakRealm() {
realmRepresentation.setRealm(TENANT_NAME);
realmRepresentation.setDuplicateEmailsAllowed(true);
realmRepresentation.setLoginWithEmailAllowed(false);
realmRepresentation.setEditUsernameAllowed(true);
realmRepresentation.setEnabled(true);
realmRepresentation.setRequiredActions(requiredActions());
realmRepresentation.setComponents(realmComponents());
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/org/folio/tm/support/TestConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public static TenantDescriptor tenantDescriptor(String id) {
}

public static Realm realmDescriptor() {
return new Realm(TENANT_ID.toString(), true, TENANT_NAME, TRUE, FALSE, emptyList(), emptyMap());
return new Realm(TENANT_ID.toString(), true, TENANT_NAME, TRUE, FALSE, TRUE, emptyList(), emptyMap());
}

public static ProtocolMapperRepresentation usernameProtocolMapper() {
Expand Down

0 comments on commit 98abd73

Please sign in to comment.