How to use passport-wsfed-saml2 - 1 common examples

To help you get started, we’ve selected a few passport-wsfed-saml2 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 magda-io / magda / magda-gateway / src / oauth2 / vanguard.ts View on Github external
const passport = options.passport;
    const wsFedIdpUrl = options.wsFedIdpUrl;
    const wsFedRealm = options.wsFedRealm;
    const wsFedCertificate = options.wsFedCertificate;
    const externalUrl = options.externalUrl;

    if (!wsFedIdpUrl || !wsFedRealm || !wsFedCertificate) {
        // --- we will know we didn't setup vanguard well
        throw new Error(
            "Vanguard SSO module is missing one of the following parameters: wsFedIdpUrl, wsFedRealm or wsFedCertificate"
        );
    }

    passport.use(
        STRATEGY,
        new Strategy(
            {
                identityProviderUrl: wsFedIdpUrl,
                realm: wsFedRealm,
                protocol: "wsfed",
                cert: wsFedCertificate
            },
            function(profile: any, cb: Function) {
                const email =
                    profile[
                        "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress"
                    ];
                const displayName =
                    profile[
                        "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"
                    ] || email;
                const id =

passport-wsfed-saml2

SAML2 Protocol and WS-Fed library

MIT
Latest version published 1 year ago

Package Health Score

31 / 100
Full package analysis

Popular passport-wsfed-saml2 functions