saml_idp 0.9.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +39 -45
- data/lib/saml_idp.rb +2 -1
- data/lib/saml_idp/assertion_builder.rb +28 -3
- data/lib/saml_idp/configurator.rb +4 -1
- data/lib/saml_idp/controller.rb +11 -9
- data/lib/saml_idp/encryptor.rb +0 -1
- data/lib/saml_idp/fingerprint.rb +19 -0
- data/lib/saml_idp/incoming_metadata.rb +13 -0
- data/lib/saml_idp/metadata_builder.rb +23 -8
- data/lib/saml_idp/persisted_metadata.rb +4 -0
- data/lib/saml_idp/request.rb +9 -3
- data/lib/saml_idp/response_builder.rb +19 -5
- data/lib/saml_idp/saml_response.rb +37 -16
- data/lib/saml_idp/service_provider.rb +1 -6
- data/lib/saml_idp/signable.rb +1 -2
- data/lib/saml_idp/version.rb +1 -1
- data/saml_idp.gemspec +8 -8
- data/spec/lib/saml_idp/assertion_builder_spec.rb +73 -0
- data/spec/lib/saml_idp/configurator_spec.rb +1 -0
- data/spec/lib/saml_idp/controller_spec.rb +24 -0
- data/spec/lib/saml_idp/fingerprint_spec.rb +14 -0
- data/spec/lib/saml_idp/incoming_metadata_spec.rb +15 -1
- data/spec/lib/saml_idp/metadata_builder_spec.rb +23 -0
- data/spec/lib/saml_idp/response_builder_spec.rb +3 -1
- data/spec/lib/saml_idp/saml_response_spec.rb +25 -2
- data/spec/rails_app/app/controllers/saml_controller.rb +1 -5
- data/spec/rails_app/app/controllers/saml_idp_controller.rb +47 -8
- data/{app → spec/rails_app/app}/views/saml_idp/idp/new.html.erb +1 -5
- data/{app → spec/rails_app/app}/views/saml_idp/idp/saml_post.html.erb +1 -1
- data/spec/rails_app/config/environments/development.rb +2 -0
- data/spec/spec_helper.rb +20 -1
- data/spec/support/certificates/sp_cert_req.csr +12 -0
- data/spec/support/certificates/sp_private_key.pem +16 -0
- data/spec/support/certificates/sp_x509_cert.crt +18 -0
- data/spec/support/saml_request_macros.rb +62 -3
- data/spec/support/security_helpers.rb +10 -0
- metadata +51 -28
- data/app/controllers/saml_idp/idp_controller.rb +0 -59
@@ -1,59 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
|
3
|
-
module SamlIdp
|
4
|
-
class IdpController < ActionController::Base
|
5
|
-
include SamlIdp::Controller
|
6
|
-
|
7
|
-
unloadable unless Rails::VERSION::MAJOR >= 4
|
8
|
-
protect_from_forgery
|
9
|
-
|
10
|
-
if Rails::VERSION::MAJOR >= 4
|
11
|
-
before_action :validate_saml_request, only: [:new, :create]
|
12
|
-
else
|
13
|
-
before_filter :validate_saml_request, only: [:new, :create]
|
14
|
-
end
|
15
|
-
|
16
|
-
def new
|
17
|
-
render template: "saml_idp/idp/new"
|
18
|
-
end
|
19
|
-
|
20
|
-
def show
|
21
|
-
render xml: SamlIdp.metadata.signed
|
22
|
-
end
|
23
|
-
|
24
|
-
def create
|
25
|
-
unless params[:email].blank? && params[:password].blank?
|
26
|
-
person = idp_authenticate(params[:email], params[:password])
|
27
|
-
if person.nil?
|
28
|
-
@saml_idp_fail_msg = "Incorrect email or password."
|
29
|
-
else
|
30
|
-
@saml_response = idp_make_saml_response(person)
|
31
|
-
render :template => "saml_idp/idp/saml_post", :layout => false
|
32
|
-
return
|
33
|
-
end
|
34
|
-
end
|
35
|
-
render :template => "saml_idp/idp/new"
|
36
|
-
end
|
37
|
-
|
38
|
-
def logout
|
39
|
-
idp_logout
|
40
|
-
@saml_response = idp_make_saml_response(nil)
|
41
|
-
render :template => "saml_idp/idp/saml_post", :layout => false
|
42
|
-
end
|
43
|
-
|
44
|
-
def idp_logout
|
45
|
-
raise NotImplementedError
|
46
|
-
end
|
47
|
-
private :idp_logout
|
48
|
-
|
49
|
-
def idp_authenticate(email, password)
|
50
|
-
raise NotImplementedError
|
51
|
-
end
|
52
|
-
protected :idp_authenticate
|
53
|
-
|
54
|
-
def idp_make_saml_response(person)
|
55
|
-
raise NotImplementedError
|
56
|
-
end
|
57
|
-
protected :idp_make_saml_response
|
58
|
-
end
|
59
|
-
end
|