node.js/express module to authenticate users without password

Overview

Passwordless

Passwordless is a modern node.js module for Express that allows authentication and authorization without passwords by simply sending one-time password (OTPW) tokens via email or other means. It utilizes a very similar mechanism as the reset password feature of classic websites. The module was inspired by Justin Balthrop's article "Passwords are Obsolete"

Token-based authentication is...

  • Faster to implement compared to typical user auth systems (you only need one form)
  • Better for your users as they get started with your app quickly and don't have to remember passwords
  • More secure for your users avoiding the risks of reused passwords

Getting you started

The following should provide a quick-start in using Passwordless. If you need more details check out the example, the deep dive, or the documentation. Also, don't hesitate to raise comments and questions on GitHub.

1. Install the module:

$ npm install passwordless --save

You'll also want to install a TokenStore such as MongoStore and something to deliver the tokens (be it email, SMS or any other means). For example:

$ npm install passwordless-mongostore --save

$ npm install emailjs --save

If you need to store your tokens differently consider developing a new TokenStore and let us know.

2. Require the needed modules

You will need:

  • Passwordless
  • A TokenStore to store the tokens such as MongoStore
  • Something to deliver the tokens such as emailjs for email or twilio for text messages / SMS
var passwordless = require('passwordless');
var MongoStore = require('passwordless-mongostore');
var email   = require('emailjs');

3. Setup your delivery

This is very much depending on how you want to deliver your tokens, but if you use emailjs this could look like this:

var smtpServer  = email.server.connect({
   user:    yourEmail, 
   password: yourPwd, 
   host:    yourSmtp, 
   ssl:     true
});

4. Initialize Passwordless

passwordless.init() will take your TokenStore, which will store the generated tokens as shown below for a MongoStore:

// Your MongoDB TokenStore
var pathToMongoDb = 'mongodb://localhost/passwordless-simple-mail';
passwordless.init(new MongoStore(pathToMongoDb));

5. Tell Passwordless how to deliver a token

passwordless.addDelivery(deliver) adds a new delivery mechanism. deliver is called whenever a token has to be sent. By default, the mechanism you choose should provide the user with a link in the following format:

http://www.example.com/?token={TOKEN}&uid={UID}

That's how you could do this with emailjs:

// Set up a delivery service
passwordless.addDelivery(
	function(tokenToSend, uidToSend, recipient, callback, req) {
		var host = 'localhost:3000';
		smtpServer.send({
			text:    'Hello!\nAccess your account here: http://' 
			+ host + '?token=' + tokenToSend + '&uid=' 
			+ encodeURIComponent(uidToSend), 
			from:    yourEmail, 
			to:      recipient,
			subject: 'Token for ' + host
		}, function(err, message) { 
			if(err) {
				console.log(err);
			}
			callback(err);
		});
});

6. Setup the middleware for express

app.use(passwordless.sessionSupport());
app.use(passwordless.acceptToken({ successRedirect: '/'}));

sessionSupport() makes the login persistent, so the user will stay logged in while browsing your site. Make sure to have added your session middleware before this line. Have a look at express-session how to setup sessions if you are unsure. Please be aware: If you decide to use cookie-session rather than e.g. express-session as your middleware you have to set passwordless.init(tokenStore, {skipForceSessionSave:true})

acceptToken() will accept incoming tokens and authenticate the user (see the URL in step 5). While the option successRedirect is not strictly needed, it is strongly recommended to use it to avoid leaking valid tokens via the referrer header of outgoing HTTP links. When provided, the user will be forwarded to the given URL as soon as she has been authenticated.

Instead of accepting tokens on any URL as done above you can also restrict the acceptance of tokens to certain URLs:

// Accept tokens only on /logged_in (be sure to change the
// URL you deliver in step 5)
router.get('/logged_in', passwordless.acceptToken(), 
	function(req, res) {
		res.render('homepage');
});

7. The router

The following takes for granted that you've already setup your router var router = express.Router(); as explained in the express docs

You will need at least URLs to:

  • Display a page asking for the user's email (or phone number, ...)
  • Receive these details (via POST) and identify the user

For example like this:

/* GET login screen. */
router.get('/login', function(req, res) {
   res.render('login');
});

/* POST login details. */
router.post('/sendtoken', 
	passwordless.requestToken(
		// Turn the email address into an user's ID
		function(user, delivery, callback, req) {
			// usually you would want something like:
			User.find({email: user}, callback(ret) {
			   if(ret)
			      callback(null, ret.id)
			   else
			      callback(null, null)
	      })
	      // but you could also do the following 
	      // if you want to allow anyone:
	      // callback(null, user);
		}),
	function(req, res) {
	   // success!
  		res.render('sent');
});

What happens here? passwordless.requestToken(getUserId) has two tasks: Making sure the email address exists and transforming it into a proper user ID that will become the identifier from now on. For example [email protected] becomes 123 or 'u1002'. You call callback(null, ID) if all is good, callback(null, null) if you don't know this email address, and callback('error', null) if something went wrong. At this stage, please make sure that you've added middleware to parse POST data (such as body-parser).

Most likely, you want a user registration page where you take an email address and any other user details and generate an ID. However, you can also simply accept any email address by skipping the lookup and just calling callback(null, user).

In an even simpler scenario and if you just have a fixed list of users do the following:

// GET login as above

var users = [
	{ id: 1, email: '[email protected]' },
	{ id: 2, email: '[email protected]' }
];

/* POST login details. */
router.post('/sendtoken', 
	passwordless.requestToken(
		function(user, delivery, callback) {
			for (var i = users.length - 1; i >= 0; i--) {
				if(users[i].email === user.toLowerCase()) {
					return callback(null, users[i].id);
				}
			}
			callback(null, null);
		}),
		function(req, res) {
			// success!
		res.render('sent');
});

8. Login page

All you need is a form where users enter their email address, for example:

<html>
	<body>
		<h1>Login</h1>
		<form action="/sendtoken" method="POST">
			Email:
			<br><input name="user" type="text">
			<br><input type="submit" value="Login">
		</form>
	</body>
</html>

By default, Passwordless will look for a field called user submitted via POST.

9. Protect your pages

You can protect all pages that should only be accessed by authenticated users by using the passwordless.restricted() middleware, for example:

/* GET restricted site. */
router.get('/restricted', passwordless.restricted(),
 function(req, res) {
  // render the secret page
});

You can also protect a full path, by adding:

router.use('/admin', passwordless.restricted());

10. Who is logged in?

Passwordless stores the user ID in req.user (this can be changed via configuration). So, if you want to display the user's details or use them for further requests, do something like:

router.get('/admin', passwordless.restricted(),
	function(req, res) {
		res.render('admin', { user: req.user });
});

You could also create a middleware that is adding the user to any request and enriching it with all user details. Make sure, though, that you are adding this middleware after acceptToken() and sessionSupport():

app.use(function(req, res, next) {
	if(req.user) {
		User.findById(req.user, function(error, user) {
			res.locals.user = user;
			next();
		});
	} else { 
		next();
	}
})

Common options

Logout

Just call passwordless.logout() as in:

router.get('/logout', passwordless.logout(),
	function(req, res) {
		res.redirect('/');
});

Redirects

Redirect non-authorised users who try to access protected resources with failureRedirect (default is a 401 error page):

router.get('/restricted', 
	passwordless.restricted({ failureRedirect: '/login' });

Redirect unsuccessful login attempts with failureRedirect (default is a 401 or 400 error page):

router.post('/login', 
	passwordless.requestToken(function(user, delivery, callback) {
		// identify user
}, { failureRedirect: '/login' }),
	function(req, res){
		// success
});

After the successful authentication through acceptToken(), you can redirect the user to a specific URL with successRedirect:

app.use(passwordless.acceptToken(
	{ successRedirect: '/' }));

While the option successRedirect is not strictly needed, it is strongly recommended to use it to avoid leaking valid tokens via the referrer header of outgoing HTTP links on your site. When provided, the user will be forwarded to the given URL as soon as she has been authenticated. If not provided, Passwordless will simply call the next middleware.

Error flashes

Error flashes are session-based error messages that are pushed to the user with the next request. For example, you might want to show a certain message when the user authentication was not successful or when a user was redirected after accessing a resource she should not have access to. To make this work, you need to have sessions enabled and a flash middleware such as connect-flash installed.

Error flashes are supported in any middleware of Passwordless that supports failureRedirect (see above) but only(!) if failureRedirect is also supplied:

  • restricted() when the user is not authorized to access the resource
  • requestToken() when the supplied user details are unknown

As an example:

router.post('/login', 
	passwordless.requestToken(function(user, delivery, callback) {
		// identify user
}, { failureRedirect: '/login', failureFlash: 'This user is unknown!' }),
	function(req, res){
		// success
});

The error flashes are pushed onto the passwordless array of your flash middleware. Check out the connect-flash docs how to pull the error messages, but a typical scenario should look like this:

router.get('/mistake',
	function(req, res) {
		var errors = req.flash('passwordless'), errHtml;
		for (var i = errors.length - 1; i >= 0; i--) {
			errHtml += '<p>' + errors[i] + '</p>';
		}
		res.send(200, errHtml);
});

Success flashes

Similar to error flashes success flashes are session-based messages that are pushed to the user with the next request. For example, you might want to show a certain message when the user has clicked on the token URL and the token was accepted by the system. To make this work, you need to have sessions enabled and a flash middleware such as connect-flash installed.

Success flashes are supported by the following middleware of Passwordless:

  • acceptToken() when the token was successfully validated
  • logout() when the user was logged in and was successfully logged out
  • requestToken() when the token was successfully stored and send out to the user

Consider the following example:

router.get('/logout', passwordless.logout( 
	{successFlash: 'Hope to see you soon!'} ),
	function(req, res) {
  	res.redirect('/home');
});

The messages are pushed onto the passwordless-success array of your flash middleware. Check out the connect-flash docs how to pull the messages, but a typical scenario should look like this:

router.get('/home',
	function(req, res) {
		var successes = req.flash('passwordless-success'), html;
		for (var i = successes.length - 1; i >= 0; i--) {
			html += '<p>' + successes[i] + '</p>';
		}
		res.send(200, html);
});

2-step authentication (e.g. for SMS)

For some token-delivery channels you want to have the shortest possible token (e.g. for text messages). One way to do so is to remove the user ID from the token URL and to only keep the token for itself. The user ID is then kept in the session. In practice his could look like this: A user types in his phone number, hits submit, is redirected to another page where she has to type in the token received per SMS, and then hit submit another time.

To achieve this, requestToken stores the requested UID in req.passwordless.uidToAuth. Putting it all together, take the following steps:

1: Read out req.passwordless.uidToAuth

// Display a new form after the user has submitted the phone number
router.post('/sendtoken', passwordless.requestToken(function(...) { },
	function(req, res) {
  	res.render('secondstep', { uid: req.passwordless.uidToAuth });
});

2: Display another form to submit the token submitting the UID in a hidden input

<html>
	<body>
		<h1>Login</h1>
		<p>You should have received a token via SMS. Type it in below:</p>
		<form action="/auth" method="POST">
			Token:
			<br><input name="token" type="text">
			<input type="hidden" name="uid" value="<%= uid %>">
			<br><input type="submit" value="Login">
		</form>
	</body>
</html>

3: Allow POST to accept tokens

router.post('/auth', passwordless.acceptToken({ allowPost: true }),
	function(req, res) {
		// success!
});

Successful login and redirect to origin

Passwordless supports the redirect of users to the login page, remembering the original URL, and then redirecting them again to the originally requested page as soon as the token has been accepted. Due to the many steps involved, several modifications have to be undertaken:

1: Set originField and failureRedirect for passwordless.restricted()

Doing this will call /login with /login?origin=/admin to allow later reuse

router.get('/admin', passwordless.restricted( 
	{ originField: 'origin', failureRedirect: '/login' }));

2: Display origin as hidden field on the login page

Be sure to pass origin to the page renderer.

<form action="/sendtoken" method="POST">
	Token:
	<br><input name="token" type="text">
	<input type="hidden" name="origin" value="<%= origin %>">
	<br><input type="submit" value="Login">
</form>

3: Let requestToken() accept origin

This will store the original URL next to the token in the TokenStore.

app.post('/sendtoken', passwordless.requestToken(function(...) { }, 
	{ originField: 'origin' }),
	function(req, res){
		// successfully sent
});

4: Reconfigure acceptToken() middleware

app.use(passwordless.acceptToken( { enableOriginRedirect: true } ));

Several delivery strategies

In case you want to use several ways to send out tokens you have to add several delivery strategies to Passwordless as shown below:

passwordless.addDelivery('email', 
	function(tokenToSend, uidToSend, recipient, callback) {
		// send the token to recipient
});
passwordless.addDelivery('sms', 
	function(tokenToSend, uidToSend, recipient, callback) {
		// send the token to recipient
});

To simplify your code, provide the field delivery to your HTML page which submits the recipient details. Afterwards, requestToken() will allow you to distinguish between the different methods:

router.post('/sendtoken', 
	passwordless.requestToken(
		function(user, delivery, callback) {
			if(delivery === 'sms')
				// lookup phone number
			else if(delivery === 'email')
				// lookup email
		}),
	function(req, res) {
  		res.render('sent');
});

Modify lifetime of a token

This is particularly useful if you use shorter tokens than the default to keep security on a high level:

// Lifetime in ms for the specific delivery strategy
passwordless.addDelivery(
	function(tokenToSend, uidToSend, recipient, callback) {
		// send the token to recipient
}, { ttl: 1000*60*10 });

Allow token reuse

By default, all tokens are invalidated after they have been used by the user. Should a user try to use the same token again and is not yet logged in, she will not be authenticated. In some cases (e.g. stateless operation or increased convenience) you might want to allow the reuse of tokens. Please be aware that this might open up your users to the risk of valid tokens being used by third parties without the user being aware of it.

To enable the reuse of tokens call init() with the option allowTokenReuse: true, as shown here:

passwordless.init(new TokenStore(), 
	{ allowTokenReuse: true });

Different tokens

You can generate your own tokens. This is not recommended except you face delivery constraints such as SMS-based authentication. If you reduce the complexity of the token, please consider reducing as well the lifetime of the token (see above):

passwordless.addDelivery(
	function(tokenToSend, uidToSend, recipient, callback) {
		// send the token to recipient
}, {tokenAlgorithm: function() {return 'random'}});

Stateless operation

Just remove the app.use(passwordless.sessionSupport()); middleware. Every request for a restricted resource has then to be combined with a token and uid. You should consider the following points:

  • By default, tokens are invalidated after their first use. For stateless operations you should call passwordless.init() with the following option: passwordless.init(tokenStore, {allowTokenReuse:true}) (for details see above)
  • Tokens have a limited lifetime. Consider extending it (for details see above), but be aware about the involved security risks
  • Consider switching off redirects such as successRedirect on the acceptToken() middleware

The tokens and security

By default, tokens are generated using 16 Bytes of pseudo-random data as produced by the cryptographically strong crypto library of Node.js. This can be considered strong enough to withstand brute force attacks especially when combined with a finite time-to-live (set by default to 1h). In addition, it is absolutely mandatory to store the tokens securely by hashing and salting them (done by default with TokenStores such as MongoStore). Security can be further enhanced by limiting the number of tries per user ID before locking that user out from the service for a certain amount of time.

Further documentation

Tests

Download the whole repository and call: $ npm test

License

MIT License

Author

Florian Heinemann @thesumofall

Comments
  • The example application seems no to work

    The example application seems no to work

    Hello,

    Thanks for this lib. I'm trying to use it, but I can't get logged in.

    So I tried to start from the example to gradually add features I want... but I can't get logged in the example too. I've just installed the example, bypassed the email to just log the url and return callback(). When I open the url, the page shows User: Not logged in... I can't figure what's happening...

    opened by Proxiweb 9
  • 400 bad request

    400 bad request

    Do you possible know why I am getting 400 all the time with the code in topic-passwordless branch here: https://github.com/dolohow/icarus/tree/topic-passwordless

    also are you using mailing list, irc or something?

    opened by dolohow 8
  • Statless mode and restriced access

    Statless mode and restriced access

    Do you know why I cannot get access to restricted content when using stateless mode? I get the token and uid from email and I am passing it using request parameters provided by REST Client and I always get the 401.

    router.get('/restricted', passwordless.restricted(),
      function(req, res) {
        res.send('success');
      });
    
    opened by dolohow 8
  • Prevent spamming emails of registered users?

    Prevent spamming emails of registered users?

    Hi,

    Great library but I have a stupid question. Is there a way to prevent spamming the email of registered user by the random attacker?

    Any suggestions for writing error handling would be appreciated!

    I use express 4.X.

    opened by gautamanand25 7
  • requestToken() never ends

    requestToken() never ends

    Hi,

    First, thanks for your library. It works almost like a charm! 👍 But I have a small issue and I can't find a way to fix it (I'm a kind of newbie)...

    Using your own example (for testing purpose), I've set my /sendtoken route, but the request never ends: the email containing the token is sent, the token works... but - using my example - I can't console.log('end here') or diplay sent.

    I tried a few things without any success. It seems to miss a next(), but you do not use it on your docs.

    Do you have an idea what's going on?

    Thanks a lot.

    const express = require('express')
    const passwordless = require('passwordless')
    const router = express.Router({ mergeParams: true })
    
    var users = [
      { id: '1', email: '[email protected]' },
      { id: '2', email: '[email protected]' }
    ]
    
    // POST route
    router.post(
      '/sendtoken',
      function(req, res, next) {
        console.log('enter here') // <-- I can console.log() this message
        next()
      },
      passwordless.requestToken(function(user, delivery, callback) {
        console.log('inside requesttoken') // <-- I can console.log() this message
        for (var i = users.length - 1; i >= 0; i--) {
          if (users[i].email === user.toLowerCase()) {
            return callback(null, users[i].id)
          }
        }
        callback(null, null)
      }),
      function(req, res) {
        console.log('end here') // <-- I CANNOT console.log() this message
        res.sent('sent')
      }
    )
    
    opened by charnould 6
  • Handle exception during signing up

    Handle exception during signing up

    Hi, I have a signup form with some more fields except for email/user, I need to persist those information when mailing is successfull. Should it be handled in addDelivery() or requestToken()? I prefer to do that in addDelivery(), however req.body is not exposed? but if using requestToken() method, then how to handle mailing exception?

    passwordless.addDelivery(
      function(tokenToSend, uidToSend, recipient, callback) {
        var host = 'localhost:3000';
        smtpServer.send({... }, function(err, message) { 
          if(err) {
            // do not signup      
            console.log(err);
          }
          // mailed success and proceed with signup
          callback(err);
        });
    });
    
    opened by panzhangwang 6
  • passwordless with Koa js

    passwordless with Koa js

    Hi guys, Does passwordless work well with Koa instead of Express? I find we cannot make them work together because Koa middleware is a little different from Express, anybody can help? Thanks in advance.

    opened by wenboSky 5
  • Different Email bodies depending on input

    Different Email bodies depending on input

    Hi, I am creating dynamic email bodies and want to be able to specify which body to use ( from a range of templates) when the token is sent to the recipient. For instance if delivery === 'template1' then it will send one body, etc etc for template2/3... These templates have different fields that need filling before sending, but I won't know what the values are until just before sending.

    passwordless.addDelivery('templateX', function(tokenToSend, uidToSend, recipient,
            callback) {
    

    addDelivery doesn't seem to allow me to pass in other paramers - for instance the name of the template to use, and the parameters to populate it with.

    Can you recommend a way for me doing this please?

    EDIT: I suppose the bit I want to be able to pass in are the parameters to the message object that will then be used by mandrill to send the email

            var message = {
                "html": emailText(true, tokenToSend, uidToSend),
                "text": emailText(false, tokenToSend, uidToSend),
                "subject": config.mandrill.subject,
                "from_email": config.mandrill.from,
                "from_name": config.mandrill.fromname,
                "to": [{
                    "email": recipient,
                    "name": "",
                    "type": "to"
                }],
                "headers": {
                    "Reply-To": config.mandrill.from
                },
            };
    

    Thanks Alex

    opened by amlwwalker 5
  • Swap out base58 dependency

    Swap out base58 dependency

    Any chance you could swap out the base58-native dependency for bs58 module instead?

    Appears to me that bs58 is more actively maintained, is pure js implementation and therefore more portable (doesn't require compilers, python, etc). Currently passwordless can't be npm installed on Windows without Visual Studio Express or Windows SDK, and python installed (for node-gyp). This is because of the bignum dependency in base58-native.

    https://www.npmjs.org/package/bs58 https://github.com/cryptocoinjs/bs58

    Also wouldn't be surprised if bs58 performs better.

    opened by lloydcotten 5
  • Implement passwordless-pouchstore

    Implement passwordless-pouchstore

    I am planning to use passwordless with my pouchdb based app, so implementing a pouchdb store for the tokens, not completely necessary but easier than installing another database.

    One thing that would have been useful would be to have an implementation of an in memory passwordless store that just used plain js objects, right now I am trying to reverse engineer what mongo / redis are supposed to be doing

    opened by daleharvey 5
  • use passwordless.requestToken in custom middleware

    use passwordless.requestToken in custom middleware

    hey what i what do is to call passwordless.requestToken insid anther middleware its look like this

    const requestToken = (req, res, next) => {
      const passwordless = req.okliveOptions.passwordless;
      console.log(passwordless.requestToken);
      passwordless.requestToken((user, delivery, callback) => {
    
        callback(null, user);
      });
    };
    

    but is get stuck the function not working any help?

    opened by yotavm 4
  • (Passwordless.net has a different owner)Is this project is still active ?

    (Passwordless.net has a different owner)Is this project is still active ?

    Florian firstly, thanks for your work! Was about to suggest this npm package to someone but first decided to check https://passwordless.net. Looks like it has changed an owner and now about the password generation rather than anything useful.
    Just want to know is this package is still active and maintained before actually suggesting it?

    opened by cheburan 1
  • Passing extra fields between the login form and delivery function

    Passing extra fields between the login form and delivery function

    I need to give some context to my email notifications. I can personalize the login form accordingly with extra values. Is it possible to access my hidden fields values (req.body) in the "sendToken" route? I might be missing something, but 'm not sure how it'd be possible to access the req/res context within the passwordless.requestToken function. Thanks!

    opened by iplanwebsites 0
  • 400 Bad Request - insufficient error

    400 Bad Request - insufficient error

    I keep getting an error 400 "Bad request" on the client side. I tracked it down to this line:

    		} else if(!deliveryMethod || !user) {
    			return sendError(400);
    		}
    

    Just "400" alone isn't a very good error. A slightly better message would be "delivery method or user missing" but obviously this is only slightly better.

    If someone can either point me in the right direction or confirm that the above error message is good, i'll make a PR.

    The actual problem I had was that I used body-parser wrong. just for info..

    Thinking about it I could have used a check where an empty or missing body gives an error.

    opened by KristerV 0
  • Prevent users figuring out which emails are accepted?

    Prevent users figuring out which emails are accepted?

    For the passwordless.requestToken() method, is there a recommended way to:

    1. accept any email and send the user onto a "check your email" message in every case
    2. then, silently look up the email and only send a token if the email is found. if the email is invalid, nothing happens

    I don't want to give users a way to figure out which email addresses are valid from the interface, but following the example code, an invalid email gives a 401 unauthorised error.

    I've settled for sending successRedirect and failureRedirect to the same view for the moment:

    router.post("/login", passwordless.requestToken(authController.sendMagicLink, {
        successRedirect: "/login/check-email",
        failureRedirect: "/login/check-email"
    }))
    router.get("login/check-email", authController.checkEmail)
    
    opened by jhackett1 0
  • Static token for heavy users/developers

    Static token for heavy users/developers

    Hello sir - - congrats on this library. I have implemented it with https://www.npmjs.com/package/passwordless-mysql-bcrypt-fix/v/1.0.3 with email address being the uid. Now my boss doesn't want to wait for an email (we have relatively unstable provider and sometimes it takes a bit long for an email to come through), and ordered me to set up some fixed tokens for developers and heavy users . . . Currently I am unable to set up this in mysql-store, as only 1 token can be alive at any time (before login). - - Is there an option to achieve that - - those passes could be hardcoded as well ? If anyone has any suggestions, please? Thank

    opened by grega913 1
Releases(v1.1.0)
Owner
Florian Heinemann
Florian Heinemann
Authentication solution for Express

Lockit Lockit is an authentication solution for Express. Check out the demo. It consists of multiple single purpose modules: lockit-login lockit-signu

Mirco Zeiss 445 Dec 28, 2022
An easy to use authentication system that can easily be built in to your Express + HBS web apps.

yoAuth An easy to use authentication system that can easily be built in to your Express + HBS web apps. Currently only supports local authentication,

null 2 Jan 21, 2022
Simple express request logger middleware for jsout.

jsout-express Simple express request logger middleware for jsout. Installation npm i jsout jsout-express -D Example Usage import {logger} from 'jsout'

Marc H. Weiner 2 Feb 25, 2022
Vue 3 + Typescript + Vite + Express

Vue 3 + Typescript + Vite + Express 目录结构

null 3 Oct 1, 2022
Express.js middleware implementation for Twitter OAuth 2.0 Client.

twitter-oauth2 Express.js middleware implementation for Twitter OAuth 2.0 Client. This module supports the following grant type available on twitter:

56 19 Dec 17, 2022
Simple, unobtrusive authentication for Node.js.

Passport Passport is Express-compatible authentication middleware for Node.js. Passport's sole purpose is to authenticate requests, which it does thro

Jared Hanson 21k Jan 7, 2023
An authorization library that supports access control models like ACL, RBAC, ABAC in Node.js and Browser

Node-Casbin News: still worry about how to write the correct node-casbin policy? Casbin online editor is coming to help! node-casbin is a powerful and

Casbin 2.1k Dec 27, 2022
The authentication-server is a node app that handles user registration, authentication & authorization with JWT.

Authentication Server The authentication-server is a node app that handles user registration, authentication & authorization with JWT. Here is the REP

Oğuz Çolak 18 Jul 24, 2022
This project shows how you can easily jwt protect your endpoints in web api apps built with node js.

JWT Protected NodeJs API This project shows how you can easily jwt protect your endpoints in web api apps built with node js. It is an easy and simple

Cihat Girgin 3 Oct 19, 2021
Node-sodium-jwt - Fast sodium-based crypto for signing and verifying json web tokens (JWT)

node-sodium-jwt Features Fast sodium-based crypto for hashing json web tokens (JWT) Relies on sodium-native to perform crypto. Built with TypeScript f

Olivier Louvignes 1 Jan 3, 2022
Authenticate your Replit Users without ReplAuth.

Replit Login An unofficial way to authenticate your Replit users Authenticate Replit users in your projects without ReplAuth. This uses the actual Rep

Ray 8 Aug 11, 2022
Generate a secured base32 one time password to authenticate your user! 🔐

Django SOTP ?? Generate a secured base32 one time password to authenticate your user! Case Study ?? Before I mention why you should use django-sotp in

アブラム (Abram) 36 Dec 22, 2022
Authenticate users into a web2 database to build a hybrid web2+web3 creator platform!

Creator Platform This project demonstrates how you can connect your web2 backend and integrate it with web3 using sign in with ethereum. Tools: React

thirdweb templates 6 Dec 16, 2022
An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

An npm package for demonstration purposes using TypeScript to build for both the ECMAScript Module format (i.e. ESM or ES Module) and CommonJS Module format. It can be used in Node.js and browser applications.

Snyk Labs 57 Dec 28, 2022
node.js auth package (password, facebook, & more) for Connect and Express apps

everyauth Authentication and authorization (password, facebook, & more) for your node.js Connect and Express apps. There is a NodeTuts screencast of e

Brian Noguchi 3.5k Dec 17, 2022
📡 Encrypt and authenticate DevTools to use it securely remotely. Add HTTPS, and authentication to --remote-debugging-port to debug, inspect and automate from anywhere and collaborate securely on bugs.

?? Encrypt and authenticate DevTools to use it securely remotely. Add HTTPS, and authentication to --remote-debugging-port to debug, inspect and automate from anywhere and collaborate securely on bugs.

Cris 9 May 5, 2022
📡 Encrypt and authenticate DevTools to use it securely remotely. Add HTTPS, and authentication to --remote-debugging-port to debug, inspect and automate from anywhere and collaborate securely on bugs.

?? Encrypt and authenticate DevTools to use it securely remotely. Add HTTPS, and authentication to --remote-debugging-port to debug, inspect and automate from anywhere and collaborate securely on bugs.

Cris 9 May 5, 2022
A simple example on how to get WalletConnect to authenticate wallets in the Expo Go app.

WalletConnect Example on Expo This is a simple example how to get WalletConnect up and running with Expo for React Native. WalletConnect's dependency

Carlos A. Wong 60 Dec 30, 2022
Utility for authorizing user in a connected app, creating JWT to authenticate against it, and perform a sample callout.

Question: What is this for? Answer: When configuring a Salesforce Connected app to use certificates to authenticate you will use JSON Web Tokens to a

null 4 Jun 15, 2022
A simple interface module that creates password-policy for your application.

This module is a simple alternate to creating complex native Regex, or tidious multidimensional checks on password-string to check required elements.

Snigdh Shourya 3 Oct 27, 2022