feat: vendor admin management and shared account settings #59
@@ -222,9 +222,11 @@ public class LogtoManagementClient {
|
||||
.retrieve()
|
||||
.body(Map.class);
|
||||
String userId = String.valueOf(userResp.get("id"));
|
||||
addUserToOrganization(orgId, userId);
|
||||
if (roleId != null) {
|
||||
assignOrganizationRole(orgId, userId, roleId);
|
||||
if (orgId != null) {
|
||||
addUserToOrganization(orgId, userId);
|
||||
if (roleId != null) {
|
||||
assignOrganizationRole(orgId, userId, roleId);
|
||||
}
|
||||
}
|
||||
return userId;
|
||||
} catch (Exception e) {
|
||||
@@ -233,7 +235,7 @@ public class LogtoManagementClient {
|
||||
}
|
||||
}
|
||||
|
||||
/** Create a user with username/password and add to org with role. */
|
||||
/** Create a user with username/password and optionally add to org with role. */
|
||||
@SuppressWarnings("unchecked")
|
||||
public String createUserWithPassword(String username, String password, String orgId, String roleId) {
|
||||
if (!isAvailable()) return null;
|
||||
@@ -246,9 +248,11 @@ public class LogtoManagementClient {
|
||||
.retrieve()
|
||||
.body(Map.class);
|
||||
String userId = String.valueOf(userResp.get("id"));
|
||||
addUserToOrganization(orgId, userId);
|
||||
if (roleId != null) {
|
||||
assignOrganizationRole(orgId, userId, roleId);
|
||||
if (orgId != null) {
|
||||
addUserToOrganization(orgId, userId);
|
||||
if (roleId != null) {
|
||||
assignOrganizationRole(orgId, userId, roleId);
|
||||
}
|
||||
}
|
||||
log.info("Created user '{}' and added to org {} with role {}", username, orgId, roleId);
|
||||
return userId;
|
||||
|
||||
Reference in New Issue
Block a user