Class: SSOlo::Templates::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/ssolo/templates/response.rb

Overview

Returns the HTML output of an auto-submitting form, to post the SAML response through to the service provider.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(server, request, name_id) ⇒ Response

Returns a new instance of Response.



12
13
14
15
16
# File 'lib/ssolo/templates/response.rb', line 12

def initialize(server, request, name_id)
  @server = server
  @request = request
  @name_id = name_id
end

Class Method Details

.callObject



8
9
10
# File 'lib/ssolo/templates/response.rb', line 8

def self.call(...)
  new(...).call
end

Instance Method Details

#callObject

rubocop:disable Metrics/MethodLength



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/ssolo/templates/response.rb', line 19

def call
  configure_idp

  "    <!DOCTYPE html>\n    <html>\n      <head>\n        <meta charset=\"utf-8\">\n        <meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge,chrome=1\">\n      </head>\n      <body onload=\"document.forms[0].submit();\" style=\"visibility:hidden;\">\n        <form method=\"post\" action=\"\#{saml_request.acs_url}\">\n          <input type=\"hidden\" name=\"SAMLResponse\" value=\"\#{saml_response}\" />\n          <input type=\"hidden\" name=\"RelayState\" value=\"\#{request.params['RelayState']}\" />\n          <input type=\"submit\" value=\"Submit\" />\n        </form>\n      </body>\n    </html>\n  HTML\nend\n"