Comments (6)
var SamlStrategy = require('passport-saml').Strategy;
router.get('/logout', function(req, res) {
return SamlStrategy.logout(req, function(err, uri) {
return res.redirect(uri);
});
});
Please could anyone help me as I am getting the error
TypeError: SamlStrategy.logout is not a function
from passport-saml.
i have one issue, i am using cookieSession for passport-saml. i get the logout working but i have configured timeout, i get an error after timeout when user is trying to logout.
_
TypeError: Cannot read property 'nameIDFormat' of undefined.
_
TimeOut configuration:
app.use(cookieSession({ name: 'session', keys: ['keyHS'], maxAge: 10000 })); app.use(passport.initialize()); app.use(passport.session());
samlStrategy.logout(req, function(){
req.logout();
res.redirect('/');
});
What should i do here to redirect the user to login page after timeout.
from passport-saml.
I just took over maintenance of this library in May, and I'm afraid I haven't gotten much into the logout functionality yet, but I'm happy to work with you on figuring it out.
Have you tried setting the logoutUrl option? I don't think it's documented, but you can see the implementation at saml.js:218.
You may also want to write out the contents of the logoutRequest being generated in saml.js:generateLogoutResponse() to make sure that looks appropriate.
from passport-saml.
Check out pull request #72 for a fix for the current implementation. You need a logoutUrl as well as entryPoint.
To actually get it to work on the IdP, you have to generate a logout request like
var samlStrategy = passport._strategy('saml');
samlStrategy.logout(req, function(err, requestUrl) {
// LOCAL logout
req.logout();
// redirect to the IdP with the encrypted SAML logout request
res.redirect(requestUrl);
});
You'd also need to have a callback from the IdP set up so they can redirect back to your site (wherever you want to have them go). Alternatively, you can have a generic exports.signout
function that only does local logout and redirects to the homepage, and use a custom exports.samlSignout
function that takes care of only the samlStrategy.logout
call.
I have this working in a local app based on my fork in the Pull Request above. Good luck!
from passport-saml.
Works perfectly on my side, thanks @wambotron !
from passport-saml.
var SamlStrategy = require('passport-saml').Strategy;
router.get('/logout', function(req, res) {return SamlStrategy.logout(req, function(err, uri) { return res.redirect(uri); });
});
Please could anyone help me as I am getting the error
TypeError: SamlStrategy.logout is not a function
FAcing the same error. Can anyone help
from passport-saml.
Related Issues (20)
- [BUG] Invalid document signature after upgrading from 2.2.0 to 4.0.1 HOT 12
- [BUG] Passport SAML is always chosen first by NestJS Passport, no matter the order HOT 1
- Invalid Signature While integrating passport-saml with OAM HOT 7
- [BUG] After an upgrade from passport-saml to @node-saml/passport-saml, assertion validation stopped working with HTTP-POST binding with an error: SAML.validatePostResponseAsync, Invalid document signature HOT 9
- Is there a way to test a provider configuration before call done() on MultiSamlStrategy? HOT 1
- Cannot POST /saml/consume HOT 3
- Possible to add custom relay state in SAML login requests? HOT 2
- Assertion signature is missing in SAML Response when using Google Workspace HOT 5
- [BUG] Invalid document signature HOT 7
- Functionality difference between Redhat UBI 8and UBI 9 HOT 3
- Reference id not matching with documentElement id HOT 8
- passport-saml requires session support (session auth) — Is it possible to do with JWT auth instead?
- [BUG] Bug in the implementation of MultiSamlStrategy on NestJS HOT 2
- [BUG] validateInResponseTo = true does not validate responses HOT 6
- Importing passport-saml fails on node v20.6.0 HOT 3
- [BUG] Importing @node-saml/passport-saml gives type error HOT 5
- [BUG] Error: Invalid document signature HOT 2
- Breaking change in v5.0.0, docs not updated (TypeError: callbackUrl is required) HOT 10
- [BUG] Callback URL switches from https to http HOT 2
- [BUG] TypeError: expirationTimer.unref is not a function HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from passport-saml.