RED-6686 - fixed tenant name

This commit is contained in:
Timo Bejan 2023-06-26 16:26:53 +03:00
parent 5702e8abab
commit 0d151108df
2 changed files with 6 additions and 4 deletions

View File

@ -51,7 +51,7 @@ public class InternalTenantsController implements InternalTenantsResource {
}
public TenantResponse getTenant(String tenantId) {
public TenantResponse getTenant(@PathVariable(TENANT_ID_PARAM) String tenantId) {
return tenantManagementService.getTenant(tenantId);
}

View File

@ -165,6 +165,7 @@ public class TenantManagementService implements TenantProvider {
} catch (Exception e) {
log.error("Tenant creation failed, rolling back", e);
tenantRepository.deleteById(tenantRequest.getTenantId());
throw new ResponseStatusException(HttpStatus.BAD_REQUEST,"Tenant creation failed", e);
}
}
@ -216,7 +217,9 @@ public class TenantManagementService implements TenantProvider {
realm.setAccessTokenLifespan(tenantUserManagementProperties.getTenantAccessTokenLifeSpan());
realm.setSsoSessionIdleTimeout(tenantUserManagementProperties.getSsoSessionIdleTimeout());
realm.getAttributesOrEmpty().put(FRONTEND_URL_PROPERY, authServerUrl);
Map<String, String> attributes = new HashMap<>();
attributes.put(FRONTEND_URL_PROPERY, authServerUrl);
realm.setAttributes(attributes);
var applicationClient = new ClientRepresentation();
applicationClient.setEnabled(true);
@ -288,8 +291,7 @@ public class TenantManagementService implements TenantProvider {
user.setLastName(redUser.getLastName());
user.setEmailVerified(true);
var roles = new ArrayList<String>();
roles.addAll(redUser.getRoles());
var roles = new ArrayList<String>(redUser.getRoles() != null ? redUser.getRoles() : new ArrayList<>());
roles.add("uma_authorization");
roles.add("offline_access");