Passport-Keystone
OpenStack Keystone authentication strategy for Passport and Node.js
Installation
npm install passport-keystone
Example
Check out the live demo, source code here, to see an express app configured for authentication with the Rackspace Cloud Identity Service, an implementation of OpenStack Keystone Service. Also included in the example is the Proxy-Keystone middleware, a simple proxy for keystone service catalog endpoints.
Documentation
Authentication
The keystone authentication strategy authenticates users using a username and
password from the POST body. The strategy requires a verify
callback, which accepts these
credentials and calls done
providing a user that is attached to req.user
.
passport;
Need to set session expiration to token expiration?
The following example uses passReqToCallback
to send the req
object to next callback, where session expiration can be configured.
passport;
Authenticate Requests
Use passport.authenticate()
, specifying the 'keystone'
strategy, to
authenticate requests.
app;
Example form markup
Username: Password:
Example request via curl
curl -v -d "username=bob&password=secret" http://127.0.0.1:3000/login
Checkout Passportjs.org for more authentication examples.