Sha256: a70031b5f436d2343619e09d68726298d761a40e5ab9f35a7ed41e2892f76edd

Contents?: true

Size: 824 Bytes

Versions: 2

Compression:

Stored size: 824 Bytes

Contents

module SamlRequestMacros

  def make_saml_request(requested_saml_acs_url = "https://foo.example.com/saml/consume")
    auth_request = OneLogin::RubySaml::Authrequest.new
    auth_url = auth_request.create(saml_settings(saml_acs_url: requested_saml_acs_url))
    CGI.unescape(auth_url.split("=").last)
  end

  def saml_settings(options = {})
    settings = OneLogin::RubySaml::Settings.new
    settings.assertion_consumer_service_url = options[:saml_acs_url] || "https://foo.example.com/saml/consume"
    settings.issuer = options[:issuer] || "http://example.com/issuer"
    settings.idp_sso_target_url = options[:idp_sso_target_url] || "http://idp.com/saml/idp"
    settings.idp_cert_fingerprint = SamlIdp::Default::FINGERPRINT
    settings.name_identifier_format = SamlIdp::Default::NAME_ID_FORMAT
    settings
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ruby-saml-idp-0.3.4 spec/support/saml_request_macros.rb
ruby-saml-idp-0.3.3 spec/support/saml_request_macros.rb