mirror of
https://github.com/omniauth/omniauth.git
synced 2022-11-09 12:31:49 -05:00
Cleanup
This commit is contained in:
parent
fe63cbb731
commit
24cc19fa73
35 changed files with 30 additions and 79 deletions
|
@ -40,7 +40,7 @@ module OmniAuth
|
|||
|
||||
def user_data
|
||||
@user_data ||= begin
|
||||
user_store_url = consumer.site + '/edam/user'
|
||||
user_store_url = 'https://www.evernote.com/edam/user'
|
||||
client = ::Evernote::Client.new(::Evernote::EDAM::UserStore::UserStore::Client, user_store_url, {})
|
||||
client.getUser(@access_token.token)
|
||||
end
|
||||
|
|
|
@ -14,8 +14,8 @@ module OmniAuth
|
|||
class Google < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
client_options = {
|
||||
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
|
||||
:authorize_url => 'https://www.google.com/accounts/OAuthAuthorizeToken',
|
||||
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
|
||||
}
|
||||
google_contacts_auth = "www.google.com/m8/feeds"
|
||||
options[:scope] ||= "http://#{google_contacts_auth}"
|
||||
|
|
|
@ -14,8 +14,8 @@ module OmniAuth
|
|||
class GoogleHealth < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
client_options = {
|
||||
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
|
||||
:authorize_url => 'https://www.google.com/accounts/OAuthAuthorizeToken',
|
||||
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
|
||||
}
|
||||
|
||||
super(app, :google_health, consumer_key, consumer_secret, client_options, options)
|
||||
|
|
|
@ -14,8 +14,8 @@ module OmniAuth
|
|||
class GoogleHealthSandbox < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
client_options = {
|
||||
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
|
||||
:authorize_url => 'https://www.google.com/accounts/OAuthAuthorizeToken',
|
||||
:token_url => 'https://www.google.com/accounts/OAuthGetAccessToken',
|
||||
}
|
||||
|
||||
super(app, :google_health_sandbox, consumer_key, consumer_secret, client_options, options)
|
||||
|
|
|
@ -10,7 +10,7 @@ module OmniAuth
|
|||
:authorize_url => 'http://www.hyves.nl/api/authorize',
|
||||
:token_url => token_url,
|
||||
:http_method => :get,
|
||||
:scheme => :header
|
||||
:scheme => :header,
|
||||
}
|
||||
super(app, :hyves, consumer_key, consumer_secret, client_options, options, &block)
|
||||
end
|
||||
|
|
|
@ -13,11 +13,11 @@ module OmniAuth
|
|||
#
|
||||
class Identica < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
super(app, :identica, consumer_key, consumer_secret,
|
||||
{
|
||||
:token_url => 'http://identi.ca/api/oauth/access_token',
|
||||
:authorize_url => 'http://identi.ca/api/oauth/authorize',
|
||||
}, options, &block)
|
||||
client_options = {
|
||||
:authorize_url => 'http://identi.ca/api/oauth/authorize',
|
||||
:token_url => 'http://identi.ca/api/oauth/access_token',
|
||||
}
|
||||
super(app, :identica, consumer_key, consumer_secret, client_options, options, &block)
|
||||
end
|
||||
|
||||
def auth_hash
|
||||
|
|
|
@ -9,9 +9,7 @@ module OmniAuth
|
|||
:authorize_url => 'https://api.linkedin.com/uas/oauth/authorize',
|
||||
:token_url => 'https://api.linkedin.com/uas/oauth/accessToken',
|
||||
}
|
||||
|
||||
client_options[:authorize_url] = '/uas/oauth/authenticate' unless options[:sign_in] == false
|
||||
|
||||
super(app, :linked_in, consumer_key, consumer_secret, client_options, options, &block)
|
||||
end
|
||||
|
||||
|
|
|
@ -17,13 +17,12 @@ module OmniAuth
|
|||
# @param [String] consumer_secret the application consumer secret
|
||||
# @option options [Boolean, true] :sign_in When true, use a sign-in flow instead of the authorization flow.
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
auth_path = (options[:sign_in] == false) ? 'http://www.meetup.com/authorize' : 'http://www.meetup.com/authenticate'
|
||||
|
||||
super(app, :meetup, consumer_key, consumer_secret,
|
||||
{
|
||||
:token_url => 'https://api.meetup.com/oauth/access',
|
||||
:authorize_url => auth_path,
|
||||
}, options)
|
||||
authorize_url = (options[:sign_in] == false) ? 'http://www.meetup.com/authorize' : 'http://www.meetup.com/authenticate'
|
||||
client_options = {
|
||||
:authorize_url => authorize_url,
|
||||
:token_url => 'https://api.meetup.com/oauth/access',
|
||||
}
|
||||
super(app, :meetup, consumer_key, consumer_secret, client_options, options)
|
||||
end
|
||||
|
||||
def auth_hash
|
||||
|
|
|
@ -13,7 +13,10 @@ module OmniAuth
|
|||
#
|
||||
class Miso < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
super(app, :miso, consumer_key, consumer_secret, {:site => 'https://gomiso.com'}, options)
|
||||
client_options = {
|
||||
:site => 'https://gomiso.com',
|
||||
}
|
||||
super(app, :miso, consumer_key, consumer_secret, client_options, options)
|
||||
end
|
||||
|
||||
def auth_hash
|
||||
|
|
|
@ -10,11 +10,11 @@ module OmniAuth
|
|||
#
|
||||
class Netflix < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
opts = {
|
||||
:token_url => 'http://api.netflix.com/oauth/access_token',
|
||||
client_options = {
|
||||
:authorize_url => 'https://api-user.netflix.com/oauth/login',
|
||||
:token_url => 'http://api.netflix.com/oauth/access_token',
|
||||
}
|
||||
super(app, :netflix, consumer_key, consumer_secret, opts, options, &block)
|
||||
super(app, :netflix, consumer_key, consumer_secret, client_options, options, &block)
|
||||
end
|
||||
|
||||
def request_phase
|
||||
|
|
|
@ -18,8 +18,8 @@ module OmniAuth
|
|||
# @param [String] consumer_secret App secret registered on plurk
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options = {}, &block)
|
||||
client_options = {
|
||||
:token_url => 'http://www.plurk.com/OAuth/access_token',
|
||||
:authorize_url => 'http://www.plurk.com/OAuth/authorize',
|
||||
:token_url => 'http://www.plurk.com/OAuth/access_token',
|
||||
}
|
||||
super(app, :plurk, consumer_key, consumer_secret, client_options, options)
|
||||
end
|
||||
|
|
|
@ -10,11 +10,11 @@ module OmniAuth
|
|||
#
|
||||
class Rdio < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
opts = {
|
||||
client_options = {
|
||||
:token_url => 'http://api.rdio.com/oauth/access_token',
|
||||
:authorize_url => 'https://www.rdio.com/oauth/authorize',
|
||||
}
|
||||
super(app, :rdio, consumer_key, consumer_secret, opts, options, &block)
|
||||
super(app, :rdio, consumer_key, consumer_secret, client_options, options, &block)
|
||||
end
|
||||
|
||||
def auth_hash
|
||||
|
|
|
@ -3,15 +3,11 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to SoundCloud via OAuth and retrieve basic
|
||||
# user information.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::SoundCloud, 'consumerkey', 'consumersecret'
|
||||
#
|
||||
|
||||
class SoundCloud < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
client_options = {
|
||||
|
|
|
@ -3,16 +3,12 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to T163 via OAuth and retrieve basic
|
||||
# user information.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::T163, 'APIKey', 'APIKeySecret'
|
||||
#
|
||||
class T163 < OmniAuth::Strategies::OAuth
|
||||
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
@api_key = consumer_key
|
||||
client_options = {
|
||||
|
|
|
@ -3,16 +3,12 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to Tqq via OAuth and retrieve basic
|
||||
# user information.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::Tqq, 'APIKey', 'APIKeySecret'
|
||||
#
|
||||
class Tqq < OmniAuth::Strategies::OAuth
|
||||
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
@api_key = consumer_key
|
||||
client_options = {
|
||||
|
|
|
@ -3,11 +3,9 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to TradeMe via OAuth and retrieve basic user information.
|
||||
# Usage:
|
||||
# use OmniAuth::Strategies::TradeMe, 'consumerkey', 'consumersecret'
|
||||
#
|
||||
class TradeMe < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
client_options = {
|
||||
|
|
|
@ -2,13 +2,10 @@ require 'omniauth/oauth'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to TripIt via OAuth and retrieve an access token for API usage
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::TripIt, 'consumerkey', 'consumersecret'
|
||||
#
|
||||
class TripIt < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
client_options = {
|
||||
|
|
|
@ -3,14 +3,11 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to TSina via OAuth and retrieve basic
|
||||
# user information.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::TSina, 'APIKey', 'APIKeySecret'
|
||||
#
|
||||
class Tsina < OmniAuth::Strategies::OAuth
|
||||
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
|
|
|
@ -3,14 +3,11 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to Tsohu via OAuth and retrieve basic
|
||||
# user information.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::Tsohu, 'APIKey', 'APIKeySecret'
|
||||
#
|
||||
class Tsohu < OmniAuth::Strategies::OAuth
|
||||
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
|
|
|
@ -2,14 +2,12 @@ require 'omniauth/oauth'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to Tumblr via OAuth and retrieve basic
|
||||
# user information.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::Tumblr, 'consumerkey', 'consumersecret'
|
||||
#
|
||||
class Tumblr < OmniAuth::Strategies::OAuth
|
||||
# Initialize the middleware
|
||||
#
|
||||
|
|
|
@ -3,14 +3,12 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to Twitter via OAuth and retrieve basic
|
||||
# user information.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::Twitter, 'consumerkey', 'consumersecret'
|
||||
#
|
||||
class Twitter < OmniAuth::Strategies::OAuth
|
||||
# Initialize the middleware
|
||||
#
|
||||
|
@ -19,7 +17,6 @@ module OmniAuth
|
|||
client_options = {
|
||||
:site => 'https://api.twitter.com',
|
||||
}
|
||||
|
||||
options[:authorize_params] = {:force_login => 'true'} if options.delete(:force_login) == true
|
||||
client_options[:authorize_path] = '/oauth/authenticate' unless options[:sign_in] == false
|
||||
super(app, :twitter, consumer_key, consumer_secret, client_options, options)
|
||||
|
|
|
@ -3,16 +3,12 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to Typepad via OAuth and retrieve basic
|
||||
# user information.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::Typepad, 'consumerkey', 'consumersecret', :application_id => 'my_type_pad_application_id'
|
||||
#
|
||||
# application_id is required.
|
||||
#
|
||||
class TypePad < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
# TypePad uses the application ID for one of the OAuth paths.
|
||||
|
|
|
@ -3,13 +3,10 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to Vimeo via OAuth and retrieve basic user information.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::Vimeo, 'consumerkey', 'consumersecret'
|
||||
#
|
||||
class Vimeo < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
client_options = {
|
||||
|
|
|
@ -3,14 +3,11 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to Yahoo via OAuth and retrieve basic
|
||||
# user information.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::Yahoo, 'consumerkey', 'consumersecret'
|
||||
#
|
||||
class Yahoo < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
client_options = {
|
||||
|
|
|
@ -9,7 +9,6 @@ module OmniAuth
|
|||
:authorize_url => 'https://www.yammer.com/oauth/authorize',
|
||||
:token_url => 'https://www.yammer.com/oauth/access_token',
|
||||
}
|
||||
|
||||
super(app, :yammer, consumer_key, consumer_secret, client_options, options)
|
||||
end
|
||||
|
||||
|
|
|
@ -5,13 +5,10 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to YouTube via OAuth and retrieve basic user info.
|
||||
#
|
||||
# Usage:
|
||||
#
|
||||
# use OmniAuth::Strategies::YouTube, 'consumerkey', 'consumersecret'
|
||||
#
|
||||
class YouTube < OmniAuth::Strategies::OAuth
|
||||
def initialize(app, consumer_key=nil, consumer_secret=nil, options={}, &block)
|
||||
client_options = {
|
||||
|
|
|
@ -3,7 +3,6 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to Bitly utilizing OAuth 2.0 and retrieve
|
||||
# basic user information.
|
||||
#
|
||||
|
|
|
@ -3,7 +3,6 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to DailyMile utilizing OAuth 2.0 and retrieve
|
||||
# basic user information.
|
||||
#
|
||||
|
|
|
@ -15,7 +15,7 @@ module OmniAuth
|
|||
protected
|
||||
|
||||
def user_data
|
||||
@data ||= MultiJson.decode(@access_token.get(client.site+"/v1/settings"),{'Authorization'=> 'OAuth'+@access_token.token})
|
||||
@data ||= MultiJson.decode(@access_token.get('https://openapi.doit.im/v1/settings'), {'Authorization' => 'OAuth' + @access_token.token})
|
||||
end
|
||||
|
||||
def request_phase
|
||||
|
|
|
@ -12,7 +12,7 @@ module OmniAuth
|
|||
options[:sign_in] ||= true
|
||||
client_options = {
|
||||
:authorize_url => authorize_url(options),
|
||||
:token_url => 'https://foursquare.com/oauth2/access_token'
|
||||
:token_url => 'https://foursquare.com/oauth2/access_token',
|
||||
}
|
||||
super(app, :foursquare, client_id, client_secret, client_options, options, &block)
|
||||
end
|
||||
|
|
|
@ -3,7 +3,6 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to Vkontakte utilizing OAuth 2.0 and retrieve
|
||||
# basic user information.
|
||||
# documentation available here:
|
||||
|
@ -20,9 +19,7 @@ module OmniAuth
|
|||
:authorize_url => 'https://connect.mail.ru/oauth/authorize',
|
||||
:token_url => 'https://connect.mail.ru/oauth/token',
|
||||
}
|
||||
|
||||
@private_key = options[:private_key]
|
||||
|
||||
super(app, :mailru, client_id, client_secret, client_options, options, &block)
|
||||
end
|
||||
|
||||
|
|
|
@ -15,7 +15,6 @@ module OmniAuth
|
|||
:authorize_url => 'https://mixi.jp/connect_authorize.pl',
|
||||
:token_url => 'https://secure.mixi-platform.com/2/token',
|
||||
}
|
||||
|
||||
super(app, :mixi, client_id, client_secret, client_options, options, &block)
|
||||
end
|
||||
|
||||
|
|
|
@ -5,8 +5,8 @@ module OmniAuth
|
|||
class Salesforce < OmniAuth::Strategies::OAuth2
|
||||
def initialize(app, client_id=nil, client_secret=nil, options={}, &block)
|
||||
client_options = {
|
||||
:token_url => 'https://login.salesforce.com/services/oauth2/token',
|
||||
:authorize_url => 'https://login.salesforce.com/services/oauth2/authorize',
|
||||
:token_url => 'https://login.salesforce.com/services/oauth2/token',
|
||||
}
|
||||
options.merge!(:response_type => 'code', :grant_type => 'authorization_code')
|
||||
super(app, :salesforce, client_id, client_secret, client_options, options, &block)
|
||||
|
|
|
@ -7,7 +7,7 @@ module OmniAuth
|
|||
def initialize(app, client_id=nil, client_secret=nil, options={}, &block)
|
||||
client_options = {
|
||||
:authorize_url => 'https://launchpad.37signals.com/authorization/new',
|
||||
:token_url => 'https://launchpad.37signals.com/authorization/token'
|
||||
:token_url => 'https://launchpad.37signals.com/authorization/token',
|
||||
}
|
||||
super(app, :thirty_seven_signals, client_id, client_secret, client_options, options, &block)
|
||||
end
|
||||
|
|
|
@ -3,7 +3,6 @@ require 'multi_json'
|
|||
|
||||
module OmniAuth
|
||||
module Strategies
|
||||
#
|
||||
# Authenticate to Vkontakte utilizing OAuth 2.0 and retrieve
|
||||
# basic user information.
|
||||
# documentation available here:
|
||||
|
|
Loading…
Reference in a new issue