Sha256: fe3951123601c1186bfe1d6e3286f84a8f47e2c98990141cf56401ef7230760a

Contents?: true

Size: 1.03 KB

Versions: 12

Compression:

Stored size: 1.03 KB

Contents

# encoding: utf-8
module SamlIdp
  class IdpController < ActionController::Base
    include SamlIdp::Controller

    unloadable
    protect_from_forgery
    before_filter :validate_saml_request, only: [:new, :create]

    def new
      render template: "saml_idp/idp/new"
    end

    def show
      render xml: SamlIdp.metadata.signed
    end

    def create
      unless params[:email].blank? && params[:password].blank?
        person = idp_authenticate(params[:email], params[:password])
        if person.nil?
          @saml_idp_fail_msg = "Incorrect email or password."
        else
          @saml_response = idp_make_saml_response(person)
          render :template => "saml_idp/idp/saml_post", :layout => false
          return
        end
      end
      render :template => "saml_idp/idp/new"
    end

    def idp_authenticate(email, password)
      raise NotImplementedError
    end
    protected :idp_authenticate

    def idp_make_saml_response(person)
      raise NotImplementedError
    end
    protected :idp_make_saml_response
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
saml_idp-0.1.1 app/controllers/saml_idp/idp_controller.rb
saml_idp-0.1.0 app/controllers/saml_idp/idp_controller.rb
saml_idp-0.0.10 app/controllers/saml_idp/idp_controller.rb
saml_idp-0.0.9 app/controllers/saml_idp/idp_controller.rb
saml_idp-0.0.8 app/controllers/saml_idp/idp_controller.rb
saml_idp-0.0.7 app/controllers/saml_idp/idp_controller.rb
saml_idp-0.0.6 app/controllers/saml_idp/idp_controller.rb
saml_idp-0.0.5 app/controllers/saml_idp/idp_controller.rb
saml_idp-0.0.4 app/controllers/saml_idp/idp_controller.rb
saml_idp-0.0.3 app/controllers/saml_idp/idp_controller.rb
saml_idp-0.0.2 app/controllers/saml_idp/idp_controller.rb
saml_idp-0.0.1 app/controllers/saml_idp/idp_controller.rb