How to use the samlp.parseRequest 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 open-rpa / openflow / OpenFlow / src / SamlProvider.ts View on Github external
app.get("/issue/", (req: any, res: any, next: any): void => {
            // passport.authenticate("session");
            if (req.query.SAMLRequest !== undefined && req.query.SAMLRequest !== null) {
                if ((req.user === undefined || req.user === null)) {
                    try {
                        // tslint:disable-next-line: max-line-length
                        samlp.parseRequest(req, samlpoptions, async (_err: any, samlRequestDom: any): Promise => {
                            res.cookie("originalUrl", req.originalUrl, { maxAge: 900000, httpOnly: true });
                            res.redirect("/");
                        });
                    } catch (error) {
                        res.body(error.message);
                        res.end();
                        console.error(error);
                    }
                } else {
                    // continue with issuing token using samlp
                    next();
                }
            } else {
                res.send("go away!");
                res.end();
            }
github DefinitelyTyped / DefinitelyTyped / samlp / samlp-tests.ts View on Github external
app.use((req: express.Request, res: express.Response, next: express.NextFunction) => {
  samlp.parseRequest(req, (err: any, data: any) => {
    next();
  });
});
github mcguinness / saml-idp / app.js View on Github external
const parseSamlRequest = function(req, res, next) {
    samlp.parseRequest(req, function(err, data) {
      if (err) {
        return res.render('error', {
          message: 'SAML AuthnRequest Parse Error: ' + err.message,
          error: err
        });
      };
      if (data) {
        req.authnRequest = {
          relayState: req.query.RelayState || req.body.RelayState,
          id: data.id,
          issuer: data.issuer,
          destination: data.destination,
          acsUrl: data.assertionConsumerServiceURL,
          forceAuthn: data.forceAuthn === 'true'
        };
        console.log('Received AuthnRequest => \n', req.authnRequest);

samlp

SAML Protocol server middleware

MIT
Latest version published 11 months ago

Package Health Score

65 / 100
Full package analysis