How to use the passport-saml.SAML function in passport-saml

To help you get started, we’ve selected a few passport-saml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github realestate-com-au / sshephalopod / lambda / Metadata.js View on Github external
requestIdExpirationPeriodMs: 3600000,
        cacheProvider: {}, // since we won't be sticking around ...
        forceAuthn: true,
        identifierFormat: "urn:oasis:names:tc:SAML:1.1:nameid-format:unspecified",
        decryptionPvk: fs.readFileSync("saml_sp.key").toString()
    };

    saml_options.callbackUrl =
        'https://' + event['api-id'] + '.execute-api.' + event.region + '.amazonaws.com/' +
        event.stage + event['resource-path'];

    console.log('callbackURL is ' + saml_options.callbackUrl);

    var certificate = fs.readFileSync("saml_sp.crt").toString();

    var saml = new SAML(saml_options);

    var metadata = saml.generateServiceProviderMetadata(certificate);

    console.log("Created metadata: %j", metadata);
    context.done(null, metadata);
};
github realestate-com-au / sshephalopod / lambda / SigningRequestPassport.js View on Github external
}, function AssertResponse(next) {
            var saml = new SAML(saml_options);

            console.log("Going to try and assert a response: %j", saml_options);

            var saml2_response = xpath.select(SAML2_RESPONSE_XPATH, saml_doc).toString();
            console.log('using saml2_response: %j', saml2_response);

            console.log("Retrieving real name from XML");
            realName = xpath.select(REALNAME_XPATH, saml_doc).toString();
            console.log("Got realName of " + realName);
            var encoded_response = new Buffer(saml2_response).toString('base64');
            var response = {
                SAMLResponse: encoded_response
            };
            saml.validatePostResponse(response, next);
        },
        function checkLoggedOut(profile, loggedOut, next) {
github realestate-com-au / sshephalopod / lambda / SigningPreAuth.js View on Github external
function createLoginRequest(next) {
            var saml = new SAML(saml_options);
            var saml_request = { callbackUrl: callback, };
            saml.generateAuthorizeRequest(saml_request, is_passive, next);
        },
        function receiveCreatedLoginRequest(req, next) {

passport-saml

SAML 2.0 authentication strategy for Passport

MIT
Latest version published 2 years ago

Package Health Score

53 / 100
Full package analysis