Skip to content

Commit

Permalink
fix: Properly output saml validation errors (#8284)
Browse files Browse the repository at this point in the history
  • Loading branch information
krynble authored Jan 10, 2024
1 parent 53612de commit 8c7f399
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions packages/cli/src/sso/saml/samlValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,13 @@ export async function validateMetadata(metadata: string): Promise<boolean> {
return true;
} else {
logger.warn('SAML Validate Metadata: Invalid metadata');
logger.warn(validationResult ? validationResult.errors.join('\n') : '');
logger.warn(
validationResult
? validationResult.errors
.map((error) => `${error.message} - ${error.rawMessage}`)
.join('\n')
: '',
);
}
} catch (error) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
Expand Down Expand Up @@ -118,7 +124,13 @@ export async function validateResponse(response: string): Promise<boolean> {
return true;
} else {
logger.warn('SAML Validate Response: Failed');
logger.warn(validationResult ? validationResult.errors.join('\n') : '');
logger.warn(
validationResult
? validationResult.errors
.map((error) => `${error.message} - ${error.rawMessage}`)
.join('\n')
: '',
);
}
} catch (error) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
Expand Down

0 comments on commit 8c7f399

Please sign in to comment.