passport-userapp
Version:
Password and token authentication strategy using UserApp for Passport
55 lines (34 loc) • 2.07 kB
Markdown
# Passport-UserApp - Example with stateless server session
<https://github.com/userapp-io/passport-userapp>
Example of how to use the UserApp Passport strategy for authenticating using an HTML form with username and password.
This example will save the session token in a cookie named `ua_session_token` so the server can be restarted without
logging out users.
## Getting Started
* Get your UserApp [App Id](https://help.userapp.io/customer/portal/articles/1322336-how-do-i-find-my-app-id-) and replace 'YOUR-USERAPP-APP-ID' in `app.js` with that id.
* Install all the dependencies:
`$ npm install`
* Start the Node.js server
`$ node app.js`
* Browse to `http://localhost:3000`
* Go to the [UserApp Dashboard](https://app.userapp.io) and create a new user.
* Try to log in with the new user.
* Also try to restart the server and check that you are still logged in.
## Help
Contact us via email at support@userapp.io or visit our [support center](https://help.userapp.io).
## License
(The MIT License)
Copyright (c) 2014 UserApp
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.