Node.js 认证中间件 Passport.js

码农软件 · 软件分类 · 单点登录框架 · 2019-04-12 23:42:26

软件介绍

Passport 是 Node.js 的认证中间件,特别灵活和模块化。可非常方便的植入任意基于 Express 的 Web 应用。支持用户名密码、Facebook 和  twitter 等认证。

特性:

  • 支持超过 140+ 种认证策略

  • 支持 OpenID 和 OAuth 单点登录

  • 可轻松处理认证成功和失败

  • 支持会话的持久化

  • 动态的 scope 和权限

  • 可选择所需的策略

  • 实现自定义策略

  • 无需在应用中安装 routes

  • 轻量级

简单使用:

passport.use(new LocalStrategy(
  function(username, password, done) {
    User.findOne({ username: username, password: password }, function (err, user) {
      done(err, user);
    });
  }
));

app.post('/login', passport.authenticate('local', { 
    successRedirect: '/',
    failureRedirect: '/login' 
}));

本文地址:https://www.codercto.com/soft/d/3459.html

Types and Programming Languages

Types and Programming Languages

Benjamin C. Pierce / The MIT Press / 2002-2-1 / USD 95.00

A type system is a syntactic method for automatically checking the absence of certain erroneous behaviors by classifying program phrases according to the kinds of values they compute. The study of typ......一起来看看 《Types and Programming Languages》 这本书的介绍吧!

JSON 在线解析
JSON 在线解析

在线 JSON 格式化工具

MD5 加密
MD5 加密

MD5 加密工具

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具