Comments (2)
@ionut72 Were you able to figure this out? If so, could you share? I've been researching this on and off for the last few weeks in my spare time, with no luck. I currently get a Failed to serialize user into session
error.
from sails-auth.
@danieltjewett
I was able to implement this feature using vesse/passport-ldapauth and created ./config/passport.js with a new provider( see issue #79 for more details).
- ./api/services/protocols/ldaputh.js - my custom protocol callback function
- ./api/services/protocols/index.js - add your custom protocol callback to existing protocols that now point to sails-auth protocols directory
- ./api/services/passport.js - extend with protocols: require('./protocols') to load your new protocol list
- ./config/passport.js - your ldapauth protocol config
The reason why you get that error is because you have no id attribute set to your returned user model. To fix this you have to call sails.services.passport.loadStrategies();
after sails boots in order to correctly load your custom ldapauth protocol(here you map LDAP result to you user schema).
I called loadStrategies in ./config/bootstrap.js like this:
sails.on('lifted', function() { sails.services.passport.loadStrategies(); });
To authenticate you have to use this route: /auth/:provider/callback
. I've created a new entry to allow POST requests.
from sails-auth.
Related Issues (20)
- Is the project still active? HOT 1
- sails.getBaseURL() is deprecated. HOT 14
- Deprecated project? HOT 1
- Broken with sails 0.12.3 HOT 2
- unique: true works bad with sails-mongo. HOT 1
- req.user always empty when calling /user/me HOT 4
- action=login error HOT 2
- login sample HOT 1
- NPM HOT 8
- LinkedIn Passport provider saved as null
- Why did you remove the "generator"? HOT 1
- Login when registerig HOT 1
- "Remember Me" functionality HOT 2
- How to redirect to a page if the login fails?
- Cannot find module when files are pulled from repo HOT 1
- issue with sails 0.12.14
- Error out of the box HOT 4
- warn: Action middleware (POLICY: passport) was bound to a target `auth/*` that doesn't match any registered actions. HOT 2
- Argon2 Support?
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 sails-auth.