This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
everyModule.submodule('oauth') | |
// . | |
// . | |
// . | |
.get('callbackPath', | |
'the callback path that the 3rd party OAuth provider redirects to after an OAuth authorization result - e.g., "/auth/twitter/callback"') | |
.step('extractTokenAndVerifier') | |
.description('extracts the request token and verifier from the url query') | |
.accepts('req res next') | |
.promises('requestToken verifier') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var oauthModule = require('./oauth2') | |
, querystring= require('querystring'); | |
var meetup = module.exports = | |
oauthModule.submodule('meetup') | |
.oauthHost('https://secure.meetup.com') | |
.apiHost('https://api.meetup.com/2') | |
.entryPath('/auth/meetup') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.github.bnoguchi.everyauth.*; | |
import com.github.bnoguchi.everyauth.modules.OAuthSubmodule; | |
public class MeetupGetter { | |
public static final Submodule MEETUP; | |
static { | |
MEETUP = OAuthSubmodule.submodule("Meetup") | |
.setOAuthHost("https://secure.meetup.com") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialization style 1 | |
var meetup = new Everyauth.OAuth({ | |
name: 'meetup', | |
oauthHost: 'https://secure.meetup.com', | |
apiHost: 'https://api.meetup.com/2', | |
accessTokenParams: { | |
grant_type: 'authorization_code' | |
}, | |
// etc. | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
everyModule.submodule('oauth') | |
.configurable({ | |
apiHost: 'e.g., https://api.twitter.com' | |
, oauthHost: 'the host for the OAuth provider' | |
, requestTokenPath: "the path on the OAuth provider's domain where we request the request token, e.g., /oauth/request_token" | |
, accessTokenPath: "the path on the OAuth provider's domain where we request the access token, e.g., /oauth/access_token" | |
, authorizePath: 'the path on the OAuth provider where you direct a visitor to login, e.g., /oauth/authorize' | |
, sendCallbackWithAuthorize: 'whether you want oauth_callback=... as a query param send with your request to /oauth/authorize' | |
, consumerKey: 'the api key provided by the OAuth provider' | |
, consumerSecret: 'the api secret provided by the OAuth provider' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
step: function (name) { | |
var steps = this._steps | |
, sequence = this._currSeq; | |
if (!sequence) | |
throw new Error("You can only declare a step after declaring a route alias via `get(...)` or `post(...)`."); | |
sequence.orderedStepNames.push(name); | |
this._currentStep = |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.get('callbackPath', | |
'the callback path that the 3rd party OAuth provider redirects to after an OAuth authorization result - e.g., "/auth/twitter/callback"') | |
.step('extractTokenAndVerifier', { | |
description: 'extracts the request token and verifier from the url query', | |
// ... | |
}) | |
.step('getSession', { | |
// ... | |
}) | |
// ... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var oauthModule = require('./oauth2') | |
, querystring= require('querystring') | |
, request = require('request'); | |
var weibo = module.exports = | |
oauthModule.submodule('weibo') | |
.configurable({ | |
scope: "There's no idea about weibo's scope" | |
}) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var weibo = module.exports = | |
oauthModule.submodule('weibo') | |
// ... | |
.get('entryPath', | |
'the link a user follows, whereupon you redirect them to the 3rd party OAuth provider dialog - e.g., "/auth/facebook"') | |
// ... | |
.get('callbackPath', | |
'the callback path that the 3rd party OAuth provider redirects to after an OAuth authorization result - e.g., "/auth/facebook/callback"') | |
// ... | |
.step('fetchOAuthUser') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unless File.exist?('Gemfile') | |
File.write('Gemfile', <<-GEMFILE) | |
source 'https://rubygems.org' | |
gem 'rails', github: 'rails/rails' | |
gem 'arel', github: 'rails/arel' | |
gem 'pg' | |
GEMFILE | |
system 'bundle' | |
end |
OlderNewer