Node.js的OAuth扩展 OhAuth

码农软件 · 软件分类 · Node.js 扩展 · 2019-04-16 22:13:58

软件介绍

OhAuth 是基于 Node.js 的扩展,用于简化 OAuth 的开发,实现客户端无重定向的 OAuth 认证支持。

示例代码:

    var Express = require('express')
      , app = Express.createServer(Express.favicon(),Express.static(__dirname))
      , OhAuth = require('./ohauth')
      , strategies = require('./ohauth-strategies');


    var cK = 'consumerKey', cS = 'consumerSecret'
        , ohAuth = new OhAuth(strategies.twitter(cK,cS,'http://127.0.0.1:1337'),app);

    app.configure(function(){
        app.use(app.router);    
    });

    app.listen(1337);
    app.get('/', function (req, res) {
      res.sendfile(__dirname + '/index.html');
    });

    // when you're done, you'll get an access key and an access secret printing out here
    app.get('/oauth/success',function(req,res){
        res.send(req.session.credentials);
    });

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

Language Implementation Patterns

Language Implementation Patterns

Terence Parr / Pragmatic Bookshelf / 2010-1-10 / USD 34.95

Knowing how to create domain-specific languages (DSLs) can give you a huge productivity boost. Instead of writing code in a general-purpose programming language, you can first build a custom language ......一起来看看 《Language Implementation Patterns》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

UNIX 时间戳转换
UNIX 时间戳转换

UNIX 时间戳转换

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具