app/controllers/dashboard_controller.rb
# Login support for SAML - GET /saml_login
Login support for SAML - GET /saml_login
Login support for SAML - GET / saml_login
def saml_login
    session[:saml_login_request] = nil
    if @user_name.blank? && request.env.key?("HTTP_X_REMOTE_USER").present?
      @user_name = params[:user_name] = request.env["HTTP_X_REMOTE_USER"].split("@").first
    else
      redirect_to :action => 'logout'
      return
    end
    user = {:name => @user_name}
    validation = validate_user(user, nil, request, :require_user => true, :timeout => 30)
    case validation.result
    when :pass
      session['referer'] = request.base_url + '/'
      session[:saml_login_request] = true
      redirect_to validation.url
      return
    when :fail
      session[:user_validation_error] = validation.flash_msg || "User validation failed"
      redirect_to :action => 'logout'
      return
    end
  end
def saml_login session [ :saml_login_request ] = nil if @user_name . blank? && request . env . key? ( "HTTP_X_REMOTE_USER" ) . present? @user_name = params [ :user_name ] = request . env [ "HTTP_X_REMOTE_USER" ] . split ( "@" ) . first else redirect_to :action => 'logout' return end user = { :name => @user_name } validation = validate_user ( user , nil , request , :require_user => true , :timeout => 30 ) case validation . result when :pass session [ 'referer' ] = request . base_url + '/' session [ :saml_login_request ] = true redirect_to validation . url return when :fail session [ :user_validation_error ] = validation . flash_msg || "User validation failed" redirect_to :action => 'logout' return end end
Login support for SAML - GET /saml_login
Login support for SAML - GET / saml_login