Merge pull request #7015 from backstage/freben/saml-3-bump

Bump `passport-saml` to version 3
This commit is contained in:
Fredrik Adelöw
2021-09-10 14:29:23 +02:00
committed by GitHub
6 changed files with 56 additions and 60 deletions
@@ -119,13 +119,13 @@ export type SamlProviderOptions = {};
export const createSamlProvider = (
_options?: SamlProviderOptions,
): AuthProviderFactory => {
return ({ providerId, globalConfig, config, tokenIssuer, logger }) => {
return ({ providerId, globalConfig, config, tokenIssuer }) => {
const opts = {
callbackUrl: `${globalConfig.baseUrl}/${providerId}/handler/frame`,
entryPoint: config.getString('entryPoint'),
logoutUrl: config.getOptionalString('logoutUrl'),
issuer: config.getString('issuer'),
cert: config.getOptionalString('cert'),
cert: config.getString('cert'),
privateCert: config.getOptionalString('privateKey'),
decryptionPvk: config.getOptionalString('decryptionPvk'),
signatureAlgorithm: config.getOptionalString('signatureAlgorithm') as
@@ -138,17 +138,6 @@ export const createSamlProvider = (
appUrl: globalConfig.appUrl,
};
// passport-saml will return an error if the `cert` key is set, and the value is empty.
// Since we read from config (such as environment variables) an empty string should be equal to being unset.
if (!opts.cert) {
logger.warn(
'SamlAuthProvider was initialized without a cert configuration parameter. ' +
'This will soon be required by the underlying passport-saml library, which may soon lead to failures to start the auth backend. ' +
'Please add an "auth.saml.cert" config parameter.',
);
delete opts.cert;
}
return new SamlAuthProvider(opts);
};
};