Module: Spid::Sinatra::Helpers

Defined in:
lib/spid/sinatra/helpers.rb

Overview

:nodoc:

Instance Method Summary collapse

Instance Method Details

#spid_login_path(idp_name:, authn_context: nil, attribute_service_index: nil) ⇒ Object



9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
# File 'lib/spid/sinatra/helpers.rb', line 9

def (
      idp_name:,
      authn_context: nil,
      attribute_service_index: nil
    )
  base_path = Spid.configuration.
  query = "idp_name=#{idp_name}"
  unless authn_context.nil?
    query = "#{query}&authn_context=#{authn_context}"
  end

  unless attribute_service_index.nil?
    query = "#{query}&attribute_service_index=#{attribute_service_index}"
  end
  "#{base_path}?#{query}"
end

#spid_logout_path(idp_name:) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/spid/sinatra/helpers.rb', line 26

def spid_logout_path(idp_name:)
  base_path = Spid.configuration.logout_path
  query = [
    "idp_name=#{idp_name}"
  ].join("&")
  "#{base_path}?#{query}"
end