https://github.com/hardillb/2fa-demo
A basic NodeJS/ExpressJS app that uses 2FA with both Google TOTP and Fido U2F
https://github.com/hardillb/2fa-demo
Last synced: 8 months ago
JSON representation
A basic NodeJS/ExpressJS app that uses 2FA with both Google TOTP and Fido U2F
- Host: GitHub
- URL: https://github.com/hardillb/2fa-demo
- Owner: hardillb
- License: apache-2.0
- Archived: true
- Created: 2016-03-28T11:24:45.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2020-12-04T15:35:02.000Z (over 5 years ago)
- Last Synced: 2025-02-03T20:51:46.001Z (over 1 year ago)
- Language: JavaScript
- Size: 120 KB
- Stars: 10
- Watchers: 4
- Forks: 6
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# 2FA-Demo
An application to demo providing multiple [Two Factor Authentication][1] mechanisms.
The application supports both TOTP method supported by the [Google Authenticator][2] application and [U2F][3] authentication tokens.
Way more detail can be found on my blog post about this [here][4]
## Running
The application requires a Mongodb database to act as a backend to store user credentials. The database URL can be either passed
in with the environment variable `MONGO_URL` or picked up from `VCAP_SERVICES`, it defaults to `mongodb://localhost/users`
https is required, a selfsigned certificate for localhost is included, but these should be replaced for a proper deployment.
Clone the project, run
`npm install`
Then
`node index.js`
Point your browser [https://localhost:3000][5]
[1]: https://en.wikipedia.org/wiki/Two-factor_authentication
[2]: https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2
[3]: https://en.wikipedia.org/wiki/Universal_2nd_Factor
[4]: http://www.hardill.me.uk/wordpress/2016/03/30/adding-2-factor-authentication-to-your-expressjs-app/
[5]: https://localhost:3000