feat: add DCB User Service API - Authentication system with KEYCLOAK - Modular architecture with services for each feature
This commit is contained in:
parent
fd43877036
commit
ab58c3f577
@ -123,7 +123,7 @@ export class KeycloakApiService {
|
||||
credentials?: any[];
|
||||
}): Promise<string> {
|
||||
|
||||
this.logger.debug(`🔍 CREATE USER - Input data:`, {
|
||||
this.logger.debug(`CREATE USER - Input data:`, {
|
||||
username: userData.username,
|
||||
hasPassword: !!userData.password,
|
||||
hasCredentials: !!userData.credentials,
|
||||
@ -153,7 +153,7 @@ export class KeycloakApiService {
|
||||
throw new BadRequestException('Password is required');
|
||||
}
|
||||
|
||||
this.logger.debug(`🔍 CREATE USER - Final Keycloak payload:`, JSON.stringify(userPayload, null, 2));
|
||||
this.logger.debug(`CREATE USER - Final Keycloak payload:`, JSON.stringify(userPayload, null, 2));
|
||||
|
||||
// Format correct des attributs
|
||||
if (userData.attributes) {
|
||||
@ -168,7 +168,7 @@ export class KeycloakApiService {
|
||||
}
|
||||
|
||||
userPayload.attributes = formattedAttributes;
|
||||
this.logger.debug(`🔍 CREATE USER - Formatted attributes:`, formattedAttributes);
|
||||
this.logger.debug(`CREATE USER - Formatted attributes:`, formattedAttributes);
|
||||
}
|
||||
|
||||
try {
|
||||
@ -184,9 +184,9 @@ export class KeycloakApiService {
|
||||
this.logger.log(`User created successfully with ID: ${users[0].id}`);
|
||||
return users[0].id!;
|
||||
} catch (error: any) {
|
||||
this.logger.error(`❌ FAILED to create user in Keycloak: ${error.message}`);
|
||||
this.logger.error(`FAILED to create user in Keycloak: ${error.message}`);
|
||||
if (error.response?.data) {
|
||||
this.logger.error(`❌ Keycloak error response: ${JSON.stringify(error.response.data)}`);
|
||||
this.logger.error(`Keycloak error response: ${JSON.stringify(error.response.data)}`);
|
||||
}
|
||||
throw error;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user