How to use the passport-oauth1.prototype function in passport-oauth1

To help you get started, we’ve selected a few passport-oauth1 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aredotna / ervell / node_modules / arena-passport / node_modules / passport-twitter / lib / strategy.js View on Github external
Strategy.prototype.authenticate = function(req, options) {
  // When a user denies authorization on Twitter, they are presented with a link
  // to return to the application in the following format (where xxx is the
  // value of the request token):
  //
  //     http://www.example.com/auth/twitter/callback?denied=xxx
  //
  // Following the link back to the application is interpreted as an
  // authentication failure.
  if (req.query && req.query.denied) {
    return this.fail();
  }
  
  // Call the base class for standard OAuth authentication.
  OAuthStrategy.prototype.authenticate.call(this, req, options);
};
github jaredhanson / passport-twitter / lib / strategy.js View on Github external
Strategy.prototype.authenticate = function(req, options) {
  // When a user denies authorization on Twitter, they are presented with a link
  // to return to the application in the following format (where xxx is the
  // value of the request token):
  //
  //     http://www.example.com/auth/twitter/callback?denied=xxx
  //
  // Following the link back to the application is interpreted as an
  // authentication failure.
  if (req.query && req.query.denied) {
    return this.fail();
  }
  
  // Call the base class for standard OAuth authentication.
  OAuthStrategy.prototype.authenticate.call(this, req, options);
};
github TIY-Austin-Front-End-Engineering / Curriculum / notes / day-38 / examples / breadcrumbs / lib / auth / adapters / trello.js View on Github external
return done(error);
				}
				var profile = JSON.parse(body);
				var namePieces = profile.fullName.split(' ');
				verify(req, accessToken, refreshToken, {
					id: profile.id,
					firstName: namePieces.shift(),
					lastName: namePieces.join(' '),
					email: null
				}, done);
			}
		);
	});
	this.name = 'trello';
};
TrelloStrategy.prototype = OAuth1Strategy.prototype;


module.exports = {
	translateProfile: (token, tokenSecret, profile, cb) => { cb(null, profile); },
	strategy: TrelloStrategy
};
github alarner / perk / lib / auth / adapters / trello.js View on Github external
request(`https://api.trello.com/1/members/me?key=${options.clientID}&token=${accessToken}`,
			(err, response, body) => {
				if (err) return done(err);
				const profile = JSON.parse(body);
				const namePieces = profile.fullName.split(' ');
				const result = { id: profile.id };
				result[config.auth.columns.user.firstName] = namePieces.shift();
				result[config.auth.columns.user.lastName] = namePieces.join(' ');
				result[config.auth.columns.user.email] = null;
				verify(req, accessToken, refreshToken, result, done);
			}
		);
	});
	this.name = 'trello';
};
TrelloStrategy.prototype = Object.create(OAuth1Strategy.prototype);


module.exports = {
	translateProfile: (token, tokenSecret, profile, cb) => { cb(null, profile); },
	strategy: TrelloStrategy,
	packageName: 'passport-oauth1'
};

passport-oauth1

OAuth 1.0 authentication strategy for Passport.

MIT
Latest version published 1 year ago

Package Health Score

53 / 100
Full package analysis