0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-10 22:22:45 -05:00

fix(core): fix saml sso connector bug (#4940)

* fix(core): fix saml sso connector bug

fix saml sso connector bug

* chore(core): add some comments

add some comments
This commit is contained in:
simeng-li 2023-11-22 11:08:43 +08:00 committed by GitHub
parent 3b3bfd750a
commit 24972ce46e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 3 deletions

View file

@ -95,12 +95,14 @@ class SamlConnector {
*
* @returns The parsed SAML assertion from IdP (with attribute mapping applied).
*/
async parseSamlAssertion(assertion: Record<string, unknown>): Promise<ExtendedSocialUserInfo> {
async parseSamlAssertion(body: Record<string, unknown>): Promise<ExtendedSocialUserInfo> {
const { x509Certificate } = await this.getSamlIdpMetadata();
const profileMap = attributeMappingPostProcessor(this.config.attributeMapping);
const identityProvider = await this.getIdentityProvider();
const samlAssertionContent = await handleSamlAssertion(assertion, identityProvider, {
// HandleSamlAssertion takes a HTTPResponse-like object, need to wrap body in a object.
const samlAssertionContent = await handleSamlAssertion({ body }, identityProvider, {
x509Certificate,
entityId: this.spEntityId,
});

View file

@ -40,7 +40,7 @@ export class SamlSsoConnector extends SamlConnector implements SingleSignOn {
async getIssuer() {
const {
serviceProvider: { entityId },
identityProvider: { entityId },
} = await this.getSamlConfig();
return entityId;
}