node-saml / passport-saml

SAML 2.0 authentication with Passport

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[BUG] Bug in the implementation of MultiSamlStrategy on NestJS

dovepa opened this issue · comments

commented

Hello everyone,
As stated in the title, my implementation of MultiSamlStrategy on NestJS is not working.

Here's a code example:

export class AzureStrategy extends PassportStrategy(MultiSamlStrategy, 'multi-saml') {
    constructor() {
        super({
                passReqToCallback: true, // makes req available in callback
                getSamlOptions: function (request, done) {
                    findProvider(request, function (err, provider) {
                        if (err) {
                            return done(err);
                        }
                        return done(null, provider.configuration);
                    });
                }
            },
            function (req, profile, done) {
                findByEmail(profile.email, function (err, user) {
                    if (err) {
                        return done(err);
                    }
                    return done(null, user);
                });
            })
    }
}

I don't understand why, but I never enter the callback function.
Additionally, I noticed that the certificates are not loaded into the strategy, even though I have properly added them to the configuration.
I also do not enter the certsToCheck function of the library.

Do you know what could be causing the problem?

Version 3.2.4

It appears you are using a deprecated version of passport-saml. Please upgrade to the latest version. This the note on this page.

commented

Hello @cjbarth ,

Thank you for your answer, but I have exactly the same behavior with "@node-saml/passport-saml": "^4.0.4",