0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-02-24 22:05:56 -05:00

fix(core): should not apply custom domain to SAML app SP entity ID (#7055)

This commit is contained in:
Darcy Ye 2025-02-19 19:14:01 +08:00 committed by GitHub
parent e0333859d3
commit 98f45de386
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 5 deletions

View file

@ -285,7 +285,7 @@ export default function samlApplicationAnonymousRoutes<T extends AnonymousRouter
log.append({ extractResultData: extractResult.data });
assertThat(
extractResult.data.issuer === samlApplication.config.entityId,
extractResult.data.issuer === samlApplication.config.spEntityId,
'application.saml.auth_request_issuer_not_match'
);
@ -385,7 +385,7 @@ export default function samlApplicationAnonymousRoutes<T extends AnonymousRouter
log.append({ extractResultData: extractResult.data });
assertThat(
extractResult.data.issuer === samlApplication.config.entityId,
extractResult.data.issuer === samlApplication.config.spEntityId,
'application.saml.auth_request_issuer_not_match'
);

View file

@ -91,9 +91,9 @@ class SamlApplicationConfig {
return this._details.secret;
}
public get entityId() {
public get spEntityId() {
assertThat(this._details.entityId, 'application.saml.entity_id_required');
return this.normalizeUrlHost(this._details.entityId);
return this._details.entityId;
}
public get acsUrl() {
@ -519,7 +519,7 @@ export class SamlApplication {
private buildSpConfig(): SamlServiceProviderConfig {
return {
entityId: this.config.entityId,
entityId: this.config.spEntityId,
acsUrl: this.config.acsUrl,
certificate: this.config.encryption?.certificate,
};