Bump passport-saml to version 3

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2021-08-31 16:33:17 +02:00
parent 2a105f4514
commit 19f45179a5
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);
};
};