User Authentication

2016-12-17  本文已影响0人  kimoCHG

1. Basic Authentication

Basic Authentication

Resources

Basic acccess authentication (Wikipedia)
Basic Access Authentication

2. Cookie-based Authentication

Cookie-based Authentication

Resources

[HTTP Cookies](https://en.wikipedia.org/wiki/HTTP_cookie
cookie-parser

3. Cookie plus Session Authentication

Resources

Sessions in Express.js
Express Session Management
Sessions in Express.js
Express Session Management

4. JSON web token Authentication

Token-based Authentication JSON Web Tokens

JSON Resources

JSON Web Tokens
RFC 7519 (JSON Web Tokens)
jsonwebtoken (Node Module)

Other Resources

Authenticate a Node.js API with JSON Web Tokens
Using JSON Web Tokens with Node.js
Token Based Authentication for Single Page Apps (SPAs)
The Ins and Outs of Token Based Authentication
The Anatomy of a JSON Web Token

5. Secure communication on HTTPS

Symmetric Key Cryptography

Public Key Cryptography

HTTPS

Generate self-signed SSL key

openssl genrsa 1024 > private.key
openssl req -new -keyprivate.key -out cert.csr
openssl x509 -req -in cert.csr -signkey private.key -out certificate.pem

Note for Windows Users

If you are using a Windows machine, you may need to install openssl. You can find some openssl binary distributions here. Also, this article gives the steps for generating the certificates in Windows. Another article provides similar instructions. Here's an online service to generate self-signed certificates.

Resources

HTTPS
HTTPS (Wikipedia)
Public Key Cryptography
Transport Layer Security

Node's HTTPS Server
Node HTTPS Server

Book
Kurose, James F., and Keith W. Ross. Computer networking: a top-down approach. Pearson, 2017, ISBN-10: 0134522206 • ISBN-13: 9780134522203.

Other Resources
Howto: Make Your Own Cert With OpenSSL on Windows
OpenSSL for Windows
How to Use SSL/TLS with Node.js
Adding HTTPS (SSL) to Express 4.X Applications
How does HTTPS actually work?

OAuth 2

OAuth Role

Flow

OAuth Flow

OAuth Resources

OAuth 2.0
OAuth
OAuth (Wikipedia)

Facebook Resources
https://developers.facebook.com/apps/

Passport Resources
passport-facebook
passport-google-oauth
passport-twitter

Other Resources
Social Authentication With Passport.js
Easy Node Authentication: Facebook
An Introduction to OAuth 2
Understanding OAuth2
The OAuth Bible

上一篇 下一篇

猜你喜欢

热点阅读