Module: OauthDoorman::UserInfoAPI

Includes:
Error
Included in:
Api
Defined in:
lib/oauth_doorman/oauth_user_info_api.rb

Instance Method Summary collapse

Methods included from Error

#process_error

Instance Method Details

#get_user_emailObject



7
8
9
10
11
# File 'lib/oauth_doorman/oauth_user_info_api.rb', line 7

def get_user_email()
  result_hash = ()

  return result_hash["email"]
end

#get_user_infoObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/oauth_doorman/oauth_user_info_api.rb', line 13

def ()
  result = nil

  begin
    url = "#{config[:user_info_url]}?access_token=#{access_token}"

    http = HTTPClient.new
    result = http.get(url).body

    process_error(result)
  rescue Exception => exception
    raise exception
  end

  return JSON.parse(result)
end