Class: OmniAuth::Strategies::Fiken

Inherits:
OAuth2
  • Object
show all
Defined in:
lib/omniauth-fiken.rb

Instance Method Summary collapse

Instance Method Details

#basic_auth_headerObject



34
35
36
# File 'lib/omniauth-fiken.rb', line 34

def basic_auth_header
  "Basic " + Base64.strict_encode64("#{options[:client_id]}:#{options[:client_secret]}")
end

#build_access_tokenObject

The Fiken API requires HTTP Basic Authentication when exchanging the code for a token (i.e. when POSTing to /v1/oauth/token)



27
28
29
30
31
32
# File 'lib/omniauth-fiken.rb', line 27

def build_access_token
  options.token_params.merge!(
    headers: { 'Authorization' => basic_auth_header },
  )
  super
end

#callback_urlObject



38
39
40
# File 'lib/omniauth-fiken.rb', line 38

def callback_url
  full_host + script_name + callback_path
end