How to use the samlp.metadata function in samlp

To help you get started, we’ve selected a few samlp 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 DefinitelyTyped / DefinitelyTyped / samlp / samlp-tests.ts View on Github external
import * as samlp from 'samlp';


// Example
const app = express();

app.get('/samlp', samlp.auth({
  issuer:     'the-issuer',
  cert:       fs.readFileSync(path.join(__dirname, 'some-cert.pem')),
  key:        fs.readFileSync(path.join(__dirname, 'some-cert.key')),
  getPostURL: function (wtrealm, wreply, req, cb) {
                return cb( null, 'http://someurl.com')
              }
}));

app.get('/samlp/FederationMetadata/2007-06/FederationMetadata.xml', samlp.metadata({
  issuer:   'the-issuer',
  cert:     fs.readFileSync(path.join(__dirname, 'some-cert.pem')),
}));


app.use((req: express.Request, res: express.Response, next: express.NextFunction) => {
  samlp.parseRequest(req, (err: any, data: any) => {
    next();
  });
});
github open-rpa / openflow / OpenFlow / src / SamlProvider.ts View on Github external
res.body(error.message);
                        res.end();
                        console.error(error);
                    }
                } else {
                    // continue with issuing token using samlp
                    next();
                }
            } else {
                res.send("go away!");
                res.end();
            }
        });

        app.get("/issue/", samlp.auth(samlpoptions));
        app.get("/issue/FederationMetadata/2007-06/FederationMetadata.xml", samlp.metadata({
            issuer: Config.saml_issuer,
            cert: cert,
        }));
        // var SessionParticipants = require('samlp/lib/sessionParticipants');

        // https://github.com/mcguinness/saml-idp/blob/master/app.js
        // https://www.diycode.cc/projects/auth0/node-samlp
        // https://github.com/auth0/node-samlp/blob/master/lib/sessionParticipants/index.js
        // app.get('/logout', samlp.logout({
        //     deflate:            true,
        //     issuer:             'the-issuer',
        //     protocolBinding:    'urn:oasis:names:tc:SAML:2.0:bindings:HTTP-Redirect',
        //     cert:               cert,
        //     key:                key
        // }));
github mcguinness / saml-idp / app.js View on Github external
app.get(IDP_PATHS.METADATA, function(req, res, next) {
    samlp.metadata(req.idp.options)(req, res);
  });

samlp

SAML Protocol server middleware

MIT
Latest version published 11 months ago

Package Health Score

65 / 100
Full package analysis