Class: OmniAuth::Strategies::PassaporteWeb

Inherits:
OAuth
  • Object
show all
Defined in:
lib/omni_auth_passaporte_web/passaporte_web.rb

Overview

Authenticate to PassaporteWeb via OAuth and retrieve an access token for API usage

Usage:

use OmniAuth::Strategies::PassaporteWeb, 'consumerkey', 'consumersecret', :client_options => {:site => 'http://sandbox.app.passaporteweb.com.br'}

Instance Method Summary collapse

Instance Method Details

#fetch_user_data_post_bodyObject



57
58
59
# File 'lib/omni_auth_passaporte_web/passaporte_web.rb', line 57

def fetch_user_data_post_body
  options['client_options']['include_expired_service_accounts'] ? {:include_expired => true} : nil
end

#user_dataObject



52
53
54
55
# File 'lib/omni_auth_passaporte_web/passaporte_web.rb', line 52

def user_data
  @result ||= access_token.post('/sso/fetchuserdata', fetch_user_data_post_body)
  @user_data ||= MultiJson.decode(@result.body)
end