Module: Whatser::OAuth

Included in:
Client
Defined in:
lib/whatser/net/oauth.rb

Instance Method Summary collapse

Instance Method Details

#get_oauth_token(code, params = {}) ⇒ Object



9
10
11
# File 'lib/whatser/net/oauth.rb', line 9

def get_oauth_token(code, params={})
  oauth_client.web_server.get_access_token( code, params)
end

#login(email, password) ⇒ Object



17
18
19
# File 'lib/whatser/net/oauth.rb', line 17

def (email, password)
  request( :get, '/oauth/access_token', {:query => password_grant_params(email, password)}, :auth => :key, :keys => auth_keys )
end

#oauth_authorize_url(params = {}) ⇒ Object



13
14
15
# File 'lib/whatser/net/oauth.rb', line 13

def oauth_authorize_url(params={})
  oauth_client.web_server.authorize_url(params)
end

#oauth_clientObject



5
6
7
# File 'lib/whatser/net/oauth.rb', line 5

def oauth_client
  OAuth2::Client.new(api_key, api_secret, :site => api_uri)
end