Class: Samlr::Request
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#body ⇒ Object
The XML payload body.
-
#initialize(options = {}) ⇒ Request
constructor
A new instance of Request.
-
#param ⇒ Object
The encoded SAML request.
-
#url(root, params = {}) ⇒ Object
Utility method to get the full redirect destination, Request#url(“idp.example.com/saml”, { :RelayState => “sp.example.com/saml” }).
Constructor Details
#initialize(options = {}) ⇒ Request
Returns a new instance of Request.
7 8 9 |
# File 'lib/samlr/request.rb', line 7 def initialize( = {}) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
5 6 7 |
# File 'lib/samlr/request.rb', line 5 def @options end |
Instance Method Details
#body ⇒ Object
The XML payload body
17 18 19 |
# File 'lib/samlr/request.rb', line 17 def body @body ||= Samlr::Tools::RequestBuilder.build() end |
#param ⇒ Object
The encoded SAML request
12 13 14 |
# File 'lib/samlr/request.rb', line 12 def param @param ||= Samlr::Tools.encode(body) end |
#url(root, params = {}) ⇒ Object
Utility method to get the full redirect destination, Request#url(“idp.example.com/saml”, { :RelayState => “sp.example.com/saml” })
22 23 24 25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/samlr/request.rb', line 22 def url(root, params = {}) dest = root.dup if dest.include?("?") dest << "&SAMLRequest=#{param}" else dest << "?SAMLRequest=#{param}" end params.each_pair do |key, value| dest << "&#{key}=#{CGI.escape(value.to_s)}" end dest end |