خرید بک لینک

Vote count: 0

I am not able to see the authnreq generated on this line request.create(settings) in sso action and so the acs action is not being called. I have provided the right certificate and id in my application. So what is that I am missing which is causing the authnreq to not get generated?

def get_saml_settings(url_base)

settings = OneLogin::RubySaml::Settings.new

  url_base ||= "http://localhost:3000"

  # Example settings data, replace this values!

  # When disabled, saml validation errors will raise an exception.
  settings.soft = true

  #SP section
  settings.issuer                         = url_base + "/saml/metadata"
  settings.assertion_consumer_service_url = url_base + "/saml/acs"
  #settings.assertion_consumer_logout_service_url = url_base + "/st_core/sessions/logout"

  # IdP section
  settings.idp_entity_id                  = "https://app.onelogin.com/saml/metadata/<id included>"
  #settings.idp_sso_target_url             = "https://app.onelogin.com/trust/saml2/http-post/sso/<id included>"
  settings.idp_sso_target_url             = "https://app.onelogin.com/saml/signon/578250"
  #settings.idp_slo_target_url             = "https://app.onelogin.com/trust/saml2/http-redirect/slo/<id included>"
  settings.idp_cert                       =<Certificate is included>

  settings.name_identifier_format         = "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress"

  # Security section
  settings.security[:authn_requests_signed] = false
  settings.security[:logout_requests_signed] = false
  settings.security[:logout_responses_signed] = false
  settings.security[:metadata_signed] = false
  settings.security[:digest_method] = XMLSecurity::Document::SHA1
  settings.security[:signature_method] = XMLSecurity::Document::RSA_SHA1

  settings
end

def sso debugger settings = StCore::SamlUser.get_saml_settings(get_url_base) if settings.nil? #render :action => :no_settings return end request = OneLogin::RubySaml::Authrequest.new redirect_to(request.create(settings, params = {}))

def acs debugger settings = StCore::SamlUser.get_saml_settings(get_url_base) response = OneLogin::RubySaml::Response.new(params[:SAMLResponse], :settings => settings)

  if response.is_valid?
    session[:nameid] = response.nameid
    session[:attributes] = response.attributes
    @attrs = session[:attributes]
    logger.info "Sucessfully logged"
    logger.info "NAMEID: #{response.nameid}"
  else
    logger.info "Response Invalid. Errors: #{response.errors}"
    @errors = response.errors
    #render :action => :fail
  end
end

def metadata
  settings = StCore::SamlUser.get_saml_settings(get_url_base)
  meta = OneLogin::RubySaml::Metadata.new
  render :xml => meta.generate(settings, true),:content_type => "application/samlmetadata+xml"
end

asked 47 secs ago

برچسب: نویسنده: استخدام کار تاريخ: سه شنبه 2 شهريور 1395 ساعت: 0:56

صفحه بندی