Class: Saml::Kit::Bindings::UrlBuilder
- Inherits:
-
Object
- Object
- Saml::Kit::Bindings::UrlBuilder
- Includes:
- Serializable
- Defined in:
- lib/saml/kit/bindings/url_builder.rb
Overview
Instance Attribute Summary collapse
-
#configuration ⇒ Object
readonly
Returns the value of attribute configuration.
Instance Method Summary collapse
- #build(saml_document, relay_state: nil) ⇒ Object
-
#initialize(configuration: Saml::Kit.configuration) ⇒ UrlBuilder
constructor
A new instance of UrlBuilder.
Methods included from Serializable
#decode, #deflate, #encode, #escape, #inflate, #unescape
Constructor Details
#initialize(configuration: Saml::Kit.configuration) ⇒ UrlBuilder
Returns a new instance of UrlBuilder.
11 12 13 |
# File 'lib/saml/kit/bindings/url_builder.rb', line 11 def initialize(configuration: Saml::Kit.configuration) @configuration = configuration end |
Instance Attribute Details
#configuration ⇒ Object (readonly)
Returns the value of attribute configuration.
9 10 11 |
# File 'lib/saml/kit/bindings/url_builder.rb', line 9 def configuration @configuration end |
Instance Method Details
#build(saml_document, relay_state: nil) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/saml/kit/bindings/url_builder.rb', line 15 def build(saml_document, relay_state: nil) if configuration.sign? payload = canonicalize(saml_document, relay_state) "#{saml_document.destination}?#{payload}&Signature=#{signature_for(payload)}" else payload = to_query_string( saml_document.query_string_parameter => serialize(saml_document.to_xml), 'RelayState' => relay_state ) "#{saml_document.destination}?#{payload}" end end |