We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello, thanks for library, it works like a charm.
But there is one problem we are currently facing – we need to configurate strategy based on req data.
Currently:
new wsfedsaml2({ // ADFS RP identifier realm: 'urn:node:wsfedapp', identityProviderUrl: 'https://my-adfs/adfs/ls', // ADFS token signing certificate thumbprint: '5D27....D27E' // or cert: fs.readFileSync("adfs_signing_key.cer") }, function (profile, done) { // ... }))
And we need:
const getParams = req => { return { .... req based params } } new wsfedsaml2(getParams, function (profile, done) { // ... }))
How do we achieve that?
The text was updated successfully, but these errors were encountered:
This is how we "patched" strategy to use it in multihost environment (SaaS like ours):
const _ = require('lodash'); const url = require('url'); const { Strategy: Wsfedsaml2 } = require('passport-wsfed-saml2'); class WsfedSaml2Strategy extends Wsfedsaml2 { constructor (getConfiguration, verify) { if (!_.isFunction(getConfiguration)) { throw new Error('Please provide a finder method'); } super({ cert: '=' // for saml base64 checking in constructor }, verify); this._getConfiguration = getConfiguration; } authenticate (req, options = {}) { this._getConfiguration(req, (err, configuration) => { if (err) { return this.fail(err); } this.options = configuration; this.options.protocol = this.options.protocol || 'wsfed'; this._passReqToCallback = !!configuration.passReqToCallback; this._saml = new this._saml.constructor(this.options); this._samlp = new this._samlp.constructor(this.options, this._saml); this._wsfed.realm = configuration.realm; this._wsfed.homerealm = configuration.homerealm; this._wsfed.identityProviderUrl = configuration.identityProviderUrl; this._wsfed.wreply = configuration.wreply; this._key = configuration.sessionKey || `${this.options.protocol}:${url.parse(configuration.identityProviderUrl || '').hostname}`; // this is not fully wrap original configuration // store, state and eventEmitter are not overrided - see this https://github.com/auth0/passport-wsfed-saml2/blob/master/lib/passport-wsfed-saml2/strategy.js#L48 return super.authenticate(req, options); }); } } module.exports = { Strategy: WsfedSaml2Strategy };
Sorry, something went wrong.
No branches or pull requests
Hello, thanks for library, it works like a charm.
But there is one problem we are currently facing – we need to configurate strategy based on req data.
Currently:
And we need:
How do we achieve that?
The text was updated successfully, but these errors were encountered: