How to use the passport-oauth1.call 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 alarner / perk / lib / auth / adapters / trello.js View on Github external
function TrelloStrategy(options, verify) {
	OAuth1Strategy.call(this, Object.assign({
		requestTokenURL: 'https://trello.com/1/OAuthGetRequestToken',
		accessTokenURL: 'https://trello.com/1/OAuthGetAccessToken',
		userAuthorizationURL: 'https://trello.com/1/OAuthAuthorizeToken',
		sessionKey: 'trello',
		consumerKey: options.clientID,
		consumerSecret: options.clientSecret
	}, options), (req, accessToken, refreshToken, profile, done) => {
		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;
github TIY-Austin-Front-End-Engineering / Curriculum / notes / day-38 / examples / breadcrumbs / lib / auth / adapters / trello.js View on Github external
function TrelloStrategy(options, verify) {
	options = options || {};
	options.requestTokenURL = options.requestTokenURL || 'https://trello.com/1/OAuthGetRequestToken';
	options.accessTokenURL = options.accessTokenURL || 'https://trello.com/1/OAuthGetAccessToken';
	options.userAuthorizationURL = options.userAuthorizationURL || 'https://trello.com/1/OAuthAuthorizeToken';
	options.sessionKey = options.sessionKey || 'trello';

	OAuth1Strategy.call(this, options, (req, accessToken, refreshToken, profile, done) => {
		request(
			'https://api.trello.com/1/members/me?key='+options.consumerKey+'&token='+accessToken,
			function (error, response, body) {
				if(error) {
					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);
			}
		);
github jaredhanson / passport-evernote / lib / strategy.js View on Github external
function Strategy(options, verify) {
  options = options || {};
  options.requestTokenURL = options.requestTokenURL || 'https://www.evernote.com/oauth';
  options.accessTokenURL = options.accessTokenURL || 'https://www.evernote.com/oauth';
  options.userAuthorizationURL = options.userAuthorizationURL || 'https://www.evernote.com/OAuth.action';
  options.sessionKey = options.sessionKey || 'oauth:evernote';
  
  OAuthStrategy.call(this, options, verify);
  this.name = 'evernote';
}
github jaredhanson / passport-dropbox / lib / strategy.js View on Github external
function Strategy(options, verify) {
  options = options || {};
  options.requestTokenURL = options.requestTokenURL || 'https://api.dropbox.com/1/oauth/request_token';
  options.accessTokenURL = options.accessTokenURL || 'https://api.dropbox.com/1/oauth/access_token';
  var params = { oauth_callback: options.callbackURL };
  options.userAuthorizationURL = options.userAuthorizationURL || 'https://www.dropbox.com/1/oauth/authorize?' + querystring.stringify(params);
  options.sessionKey = options.sessionKey || 'oauth:dropbox';

  OAuthStrategy.call(this, options, verify);
  this.name = 'dropbox';
}
github jaredhanson / passport-twitter / lib / strategy.js View on Github external
function Strategy(options, verify) {
  options = options || {};
  options.requestTokenURL = options.requestTokenURL || 'https://api.twitter.com/oauth/request_token';
  options.accessTokenURL = options.accessTokenURL || 'https://api.twitter.com/oauth/access_token';
  options.userAuthorizationURL = options.userAuthorizationURL || 'https://api.twitter.com/oauth/authenticate';
  options.sessionKey = options.sessionKey || 'oauth:twitter';
  
  OAuthStrategy.call(this, options, verify);
  this.name = 'twitter';
  this._userProfileURL = options.userProfileURL || 'https://api.twitter.com/1.1/account/verify_credentials.json';
  this._skipExtendedUserProfile = (options.skipExtendedUserProfile !== undefined) ? options.skipExtendedUserProfile : false;
  this._includeEmail = (options.includeEmail !== undefined) ? options.includeEmail : false;
  this._includeStatus = (options.includeStatus !== undefined) ? options.includeStatus : true;
  this._includeEntities = (options.includeEntities !== undefined) ? options.includeEntities : true;
}
github aredotna / ervell / node_modules / arena-passport / node_modules / passport-twitter / lib / strategy.js View on Github external
function Strategy(options, verify) {
  options = options || {};
  options.requestTokenURL = options.requestTokenURL || 'https://api.twitter.com/oauth/request_token';
  options.accessTokenURL = options.accessTokenURL || 'https://api.twitter.com/oauth/access_token';
  options.userAuthorizationURL = options.userAuthorizationURL || 'https://api.twitter.com/oauth/authenticate';
  options.sessionKey = options.sessionKey || 'oauth:twitter';
  
  OAuthStrategy.call(this, options, verify);
  this.name = 'twitter';
  this._userProfileURL = options.userProfileURL || 'https://api.twitter.com/1.1/users/show.json';
  this._skipExtendedUserProfile = (options.skipExtendedUserProfile !== undefined) ? options.skipExtendedUserProfile : false;
}
github jaredhanson / passport-evernote / lib / strategy.js View on Github external
function Strategy(options, verify) {
  options = options || {};
  options.requestTokenURL = options.requestTokenURL || 'https://www.evernote.com/oauth';
  options.accessTokenURL = options.accessTokenURL || 'https://www.evernote.com/oauth';
  options.userAuthorizationURL = options.userAuthorizationURL || 'https://www.evernote.com/OAuth.action';
  options.sessionKey = options.sessionKey || 'oauth:evernote';
  
  OAuthStrategy.call(this, options, verify);
  this.name = 'evernote';
}

passport-oauth1

OAuth 1.0 authentication strategy for Passport.

MIT
Latest version published 1 year ago

Package Health Score

53 / 100
Full package analysis