Class: OmniAuth::Strategies::Parasut

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

Overview

Authentication strategy for connecting with PARASUT APIs using OAuth2.0 the [OAuth 2.0 Specification](tools.ietf.org/html/draft-ietf-oauth-v2-10).

Constant Summary collapse

CONTENT_TYPE =
'application/vnd.api+json'.freeze

Instance Method Summary collapse

Instance Method Details

#callback_urlObject



32
33
34
# File 'lib/omniauth/strategies/parasut.rb', line 32

def callback_url
  full_host + script_name + callback_path # + query_string
end

#raw_infoObject



36
37
38
# File 'lib/omniauth/strategies/parasut.rb', line 36

def raw_info
  @raw_info ||= access_token.get('/v4/me').parsed
end

#setup_phaseObject



26
27
28
29
30
# File 'lib/omniauth/strategies/parasut.rb', line 26

def setup_phase
  ::OAuth2::Response.register_parser(:json, CONTENT_TYPE) do |body|
    MultiJson.load(body)
  end
end