Class: OmniAuth::Strategies::Sabia

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth/strategies/sabia.rb

Instance Method Summary collapse

Instance Method Details

#authorize_paramsObject



14
15
16
17
18
19
20
# File 'lib/omniauth/strategies/sabia.rb', line 14

def authorize_params
  super.tap do |params|
    if request.params['scope']
      params['scope'.to_sym] = request.params['scope']
    end
  end
end

#callback_urlObject



43
44
45
# File 'lib/omniauth/strategies/sabia.rb', line 43

def callback_url
  full_host + script_name + callback_path
end

#raw_infoObject



37
38
39
40
41
# File 'lib/omniauth/strategies/sabia.rb', line 37

def raw_info
  @raw_info ||= access_token.post('/api/perfil/dados/',
                                  :headers => {'Content-Type' => 'application/x-www-form-urlencoded'},
                                  :body => {scope: 'cpf email dados_publicos cnes receita_federal'}).parsed
end