Module: HealthGraph::Authentication

Included in:
HealthGraph
Defined in:
lib/health_graph/authentication.rb

Instance Method Summary collapse

Instance Method Details

#access_token(code) ⇒ Object



7
8
9
# File 'lib/health_graph/authentication.rb', line 7

def access_token(code)
  client.auth_code.get_token(code, :redirect_uri => authorization_redirect_url).token
end

#authorize_urlObject



3
4
5
# File 'lib/health_graph/authentication.rb', line 3

def authorize_url 
  client.auth_code.authorize_url :redirect_uri => authorization_redirect_url
end

#clientObject



11
12
13
# File 'lib/health_graph/authentication.rb', line 11

def client 
  OAuth2::Client.new client_id, client_secret, {:authorize_url => authorization_url, :token_url => access_token_url}
end