Last active
July 14, 2019 06:00
-
-
Save athiththan11/d5c4fdcd7adad232b6f7f018fbc76efd to your computer and use it in GitHub Desktop.
Updated passport-saml strategy with certificates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var passport = require('passport'); | |
var saml = require('passport-saml').Strategy; | |
// saml strategy for passport | |
var strategy = new saml( | |
{ | |
entryPoint: <provide SAML entry point url : https://localhost:9443/samlsso>, | |
issuer: <provide SAML issuer name : SampleExpressApp>, | |
protocol: <provide the protocol used : http://>, | |
logoutUrl: <provide the logout url : https://localhost:9443/samlsso>, | |
privateCert: fs.readFileSync('./security/private-key.pem', 'utf-8'), | |
cert: fs.readFileSync('./security/wso2carbon.pem', 'utf8') | |
}, | |
(profile, done) => { | |
// your body implementation on success | |
} | |
); | |
// register the strategy with passport | |
passport.use(strategy); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment