class OmniAuth::Strategies::Fidor

Constants

FIDOR_API_HEADERS
FIDOR_API_URL
FIDOR_OAUTH_URL
FIDOR_SANDBOX_URL

Public Instance Methods

authorize_params() click to toggle source
Calls superclass method
   # File lib/omniauth/strategies/fidor.rb
51 def authorize_params
52   super.tap do |params|
53     %w[client_options scopes].each do |v|
54       if request.params[v]
55         params[v.to_sym] = request.params[v]
56       end
57     end
58   end
59 end
build_access_token() click to toggle source
   # File lib/omniauth/strategies/fidor.rb
38 def build_access_token
39   verifier = request.params["code"]
40   client.auth_code.get_token(verifier, {:client_id => client.id, :redirect_uri => callback_url}.merge(token_params.to_hash(:symbolize_keys => true)))
41 end
client() click to toggle source
Calls superclass method
   # File lib/omniauth/strategies/fidor.rb
43 def client
44   options.client_options.authorize_url = build_oauth_url('/oauth/authorize')
45   options.client_options.site = build_api_url
46   options.client_options.token_url = build_oauth_url('/oauth/token')
47 
48   super
49 end
email() click to toggle source
   # File lib/omniauth/strategies/fidor.rb
65 def email
66   raw_info['email']
67 end
raw_info() click to toggle source
   # File lib/omniauth/strategies/fidor.rb
61 def raw_info
62   @raw_info ||= access_token.get('users/current', FIDOR_API_HEADERS).parsed
63 end

Private Instance Methods

build_api_url() click to toggle source
   # File lib/omniauth/strategies/fidor.rb
71 def build_api_url
72   if ENV['FIDOR_API_URL']
73     ENV['FIDOR_API_URL']
74   elsif options.production?
75     FIDOR_API_URL
76   else
77     FIDOR_SANDBOX_URL
78   end + '/'
79 end
build_oauth_url(path) click to toggle source
   # File lib/omniauth/strategies/fidor.rb
81 def build_oauth_url(path)
82   if ENV['FIDOR_OAUTH_URL']
83     ENV['FIDOR_OAUTH_URL']
84   elsif options.production?
85     FIDOR_OAUTH_URL
86   else
87     FIDOR_SANDBOX_URL
88   end + path
89 end