All Projects → jaredhanson → passport-oauth1

jaredhanson / passport-oauth1

Licence: MIT license
OAuth 1.0 authentication strategy for Passport and Node.js.

Programming Languages

javascript
184084 projects - #8 most used programming language
Makefile
30231 projects

Projects that are alternatives of or similar to passport-oauth1

Core Nestjs
A simple application demonstrating the basic usage of permissions with NestJS (JWT, Passport, Facebook, Google+, User, Group, Permission)
Stars: ✭ 347 (+1408.7%)
Mutual labels:  oauth, passport
Passport
Laravel Passport provides OAuth2 server support to Laravel.
Stars: ✭ 2,936 (+12665.22%)
Mutual labels:  oauth, passport
Login With
Stateless login-with microservice for OAuth
Stars: ✭ 2,301 (+9904.35%)
Mutual labels:  oauth, passport
Passport
Simple, unobtrusive authentication for Node.js.
Stars: ✭ 19,608 (+85152.17%)
Mutual labels:  oauth, passport
Mern Boilerplate
Fullstack boilerplate with React, Redux, Express, Mongoose, Passport Local, JWT, Facebook and Google OAuth out of the box.
Stars: ✭ 112 (+386.96%)
Mutual labels:  oauth, passport
Larapush
artisan push - Deploy your codebase into your web server with one Laravel artisan command and no SSH needed!
Stars: ✭ 150 (+552.17%)
Mutual labels:  oauth, passport
express-mvp
Express.js project template ready to go
Stars: ✭ 21 (-8.7%)
Mutual labels:  oauth, passport
laravel-api-boilerplate-passport
An API Boilerplate to create a ready-to-use REST API in seconds.
Stars: ✭ 20 (-13.04%)
Mutual labels:  passport
passport-qq
QQ connection authentication strategy for Passport and Node.js
Stars: ✭ 33 (+43.48%)
Mutual labels:  passport
oauth2-wechat
微信登录认证授权 Wechat login authorization. This package provides Wechat OAuth 2.0 support for the PHP League's OAuth 2.0 Client
Stars: ✭ 18 (-21.74%)
Mutual labels:  oauth
pyTwitchAPI
A Python 3.7 implementation of the Twitch API, EventSub and PubSub
Stars: ✭ 132 (+473.91%)
Mutual labels:  oauth
dpop
DPoP for Web Platform API JavaScript runtimes
Stars: ✭ 20 (-13.04%)
Mutual labels:  oauth
sonar-auth-gitlab-plugin
Use GitLab OAuth login in SonarQube login page
Stars: ✭ 97 (+321.74%)
Mutual labels:  oauth
todos-express-password
Todo app using Express and Passport for sign in with username and password.
Stars: ✭ 739 (+3113.04%)
Mutual labels:  passport
erlang-oauth
An Erlang OAuth 1.0 implementation
Stars: ✭ 298 (+1195.65%)
Mutual labels:  oauth
doorkeeper-openid connect
OpenID Connect extension for Doorkeeper
Stars: ✭ 152 (+560.87%)
Mutual labels:  oauth
ApigilityConsumer
🍃 Zend Framework/Laminas and Expressive/Mezzio Apigility/Laminas API Tools Client Module to consume API Services
Stars: ✭ 15 (-34.78%)
Mutual labels:  oauth
django-slack-oauth
Handles OAuth and stores slack token
Stars: ✭ 51 (+121.74%)
Mutual labels:  oauth
peerai-api
Peerism's Peer.ai API built with Truffle, Node.js, Express.js, Solidity, and Ethereum TestRPC
Stars: ✭ 18 (-21.74%)
Mutual labels:  passport
react-google-oauth2.0
React frontend login with OAuth 2.0 & integrates a Rest API backend.
Stars: ✭ 14 (-39.13%)
Mutual labels:  oauth

passport-oauth1

General-purpose OAuth 1.0 authentication strategy for Passport.

This module lets you authenticate using OAuth in your Node.js applications. By plugging into Passport, OAuth authentication can be easily and unobtrusively integrated into any application or framework that supports Connect-style middleware, including Express.

Note that this strategy provides generic OAuth support. In many cases, a provider-specific strategy can be used instead, which cuts down on unnecessary configuration, and accommodates any provider-specific quirks. See the list for supported providers.

Developers who need to implement authentication against an OAuth provider that is not already supported are encouraged to sub-class this strategy. If you choose to open source the new provider-specific strategy, please add it to the list so other people can find it.


Advertisement
Learn OAuth 2.0 - Get started as an API Security Expert
Just imagine what could happen to YOUR professional career if you had skills in OAuth > 8500 satisfied students


npm build coverage ...

Install

$ npm install passport-oauth1

Usage

Configure Strategy

The OAuth authentication strategy authenticates users using a third-party account and OAuth tokens. The provider's OAuth endpoints, as well as the consumer key and secret, are specified as options. The strategy requires a verify callback, which receives a token and profile, and calls cb providing a user.

passport.use(new OAuth1Strategy({
    requestTokenURL: 'https://www.example.com/oauth/request_token',
    accessTokenURL: 'https://www.example.com/oauth/access_token',
    userAuthorizationURL: 'https://www.example.com/oauth/authorize',
    consumerKey: EXAMPLE_CONSUMER_KEY,
    consumerSecret: EXAMPLE_CONSUMER_SECRET,
    callbackURL: "http://127.0.0.1:3000/auth/example/callback",
    signatureMethod: "RSA-SHA1"
  },
  function(token, tokenSecret, profile, cb) {
    User.findOrCreate({ exampleId: profile.id }, function (err, user) {
      return cb(err, user);
    });
  }
));

Authenticate Requests

Use passport.authenticate(), specifying the 'oauth' strategy, to authenticate requests.

For example, as route middleware in an Express application:

app.get('/auth/example',
  passport.authenticate('oauth'));

app.get('/auth/example/callback', 
  passport.authenticate('oauth', { failureRedirect: '/login' }),
  function(req, res) {
    // Successful authentication, redirect home.
    res.redirect('/');
  });

Related Modules

Contributing

Tests

The test suite is located in the test/ directory. All new features are expected to have corresponding test cases. Ensure that the complete test suite passes by executing:

$ make test

Coverage

All new feature development is expected to have test coverage. Patches that increse test coverage are happily accepted. Coverage reports can be viewed by executing:

$ make test-cov
$ make view-cov

License

The MIT License

Copyright (c) 2011-2016 Jared Hanson <http://jaredhanson.net/>

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].