Fix azure samlConfig

This commit is contained in:
Tuan Dang
2023-10-17 16:51:46 +01:00
parent 4f26a7cad3
commit 072e97b956
+3 -7
View File
@@ -291,23 +291,19 @@ const initializePassport = async () => {
}); });
interface ISAMLConfig { interface ISAMLConfig {
path: string; callbackUrl: string;
callbackURL: string;
entryPoint: string; entryPoint: string;
issuer: string; issuer: string;
cert: string; cert: string;
audience: string; audience: string;
protocol: string;
wantAuthnResponseSigned?: boolean; wantAuthnResponseSigned?: boolean;
} }
const samlConfig: ISAMLConfig = ({ const samlConfig: ISAMLConfig = ({
path: `/api/v1/sso/saml2/${ssoIdentifier}`, callbackUrl: `${await getSiteURL()}/api/v1/sso/saml2/${ssoIdentifier}`,
callbackURL: `/api/v1/sso/saml2/${ssoIdentifier}`,
entryPoint: ssoConfig.entryPoint, entryPoint: ssoConfig.entryPoint,
issuer: ssoConfig.issuer, issuer: ssoConfig.issuer,
cert: ssoConfig.cert, cert: ssoConfig.cert,
protocol: "https://",
audience: await getSiteURL() audience: await getSiteURL()
}); });
@@ -316,7 +312,7 @@ const initializePassport = async () => {
} }
if (ssoConfig.authProvider.toString() === AuthMethod.AZURE_SAML.toString()) { if (ssoConfig.authProvider.toString() === AuthMethod.AZURE_SAML.toString()) {
samlConfig.wantAuthnResponseSigned = false; samlConfig.audience = `spn:${ssoConfig.issuer}`;
} }
req.ssoConfig = ssoConfig; req.ssoConfig = ssoConfig;