Class: Doyoubuzz::Showcase::SSO

Inherits:
Object
  • Object
show all
Defined in:
lib/doyoubuzz/showcase/sso.rb

Constant Summary collapse

BASE_URL =
'http://showcase.doyoubuzz.com'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(application, key) ⇒ SSO

Returns a new instance of SSO.



7
8
9
10
# File 'lib/doyoubuzz/showcase/sso.rb', line 7

def initialize(application, key)
  @application = application
  @key = key
end

Instance Method Details

#redirect_url(locale: 'fr', timestamp:, user_attributes:) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/doyoubuzz/showcase/sso.rb', line 12

def redirect_url(locale: 'fr', timestamp:, user_attributes:)
  enforce_sso_attributes(user_attributes)

  params = sign_params(user_attributes.merge(timestamp: timestamp))
  encoded_params = URI.encode_www_form(params)

  "#{BASE_URL}/p/#{locale}/#{application}/sso?#{encoded_params}"
end