Class: OmniAuth::Strategies::BoletoSimples
- Inherits:
-
OAuth2
- Object
- OAuth2
- OmniAuth::Strategies::BoletoSimples
- Defined in:
- lib/omniauth/strategies/boletosimples.rb
Constant Summary collapse
- DEFAULT_SCOPE =
'profile'
- ENVIRONMENTS =
{ development: 'http://localhost:5000', sandbox: 'https://sandbox.boletosimples.com.br', production: 'https://boletosimples.com.br' }.freeze
Instance Method Summary collapse
Instance Method Details
#authorize_params ⇒ Object
79 80 81 82 83 |
# File 'lib/omniauth/strategies/boletosimples.rb', line 79 def super.tap do |params| params[:scope] ||= DEFAULT_SCOPE end end |
#callback_url ⇒ Object
75 76 77 |
# File 'lib/omniauth/strategies/boletosimples.rb', line 75 def callback_url [:redirect_uri] || (full_host + script_name + callback_path) end |
#raw_info ⇒ Object
71 72 73 |
# File 'lib/omniauth/strategies/boletosimples.rb', line 71 def raw_info @raw_info ||= load_identity end |
#setup_phase ⇒ Object
57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/omniauth/strategies/boletosimples.rb', line 57 def setup_phase environment = .environment || :production .[:site] = ENVIRONMENTS[environment.to_sym] .[:authorize_url] = "#{ENVIRONMENTS[environment.to_sym]}/api/v1/oauth2/authorize" return unless .user_agent .[:connection_opts] = { headers: { 'User-Agent' => .user_agent } } end |