Class: Spid::Saml2::Settings
- Inherits:
-
Object
- Object
- Spid::Saml2::Settings
- Defined in:
- lib/spid/saml2/settings.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#attribute_index ⇒ Object
readonly
Returns the value of attribute attribute_index.
-
#authn_context ⇒ Object
readonly
Returns the value of attribute authn_context.
-
#identity_provider ⇒ Object
readonly
Returns the value of attribute identity_provider.
-
#service_provider ⇒ Object
readonly
Returns the value of attribute service_provider.
Instance Method Summary collapse
- #acs_index ⇒ Object
- #certificate ⇒ Object
- #digest_method ⇒ Object
- #force_authn? ⇒ Boolean
- #idp_certificate ⇒ Object
- #idp_entity_id ⇒ Object
- #idp_slo_target_url ⇒ Object
- #idp_sso_target_url ⇒ Object
-
#initialize(identity_provider:, service_provider:, attribute_index: nil, authn_context: nil) ⇒ Settings
constructor
A new instance of Settings.
- #private_key ⇒ Object
- #signature_method ⇒ Object
- #sp_acs_binding ⇒ Object
- #sp_acs_url ⇒ Object
- #sp_attribute_services ⇒ Object
- #sp_entity_id ⇒ Object
- #sp_slo_service_binding ⇒ Object
- #sp_slo_service_url ⇒ Object
- #x509_certificate_der ⇒ Object
Constructor Details
#initialize(identity_provider:, service_provider:, attribute_index: nil, authn_context: nil) ⇒ Settings
Returns a new instance of Settings.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/spid/saml2/settings.rb', line 13 def initialize( identity_provider:, service_provider:, attribute_index: nil, authn_context: nil ) @authn_context = authn_context || Spid::L1 @attribute_index = attribute_index unless AUTHN_CONTEXTS.include?(@authn_context) raise Spid::UnknownAuthnContextError, "Provided authn_context '#{@authn_context}' is not valid:" \ " use one of #{AUTHN_CONTEXTS.join(', ')}" end @identity_provider = identity_provider @service_provider = service_provider end |
Instance Attribute Details
#attribute_index ⇒ Object (readonly)
Returns the value of attribute attribute_index.
11 12 13 |
# File 'lib/spid/saml2/settings.rb', line 11 def attribute_index @attribute_index end |
#authn_context ⇒ Object (readonly)
Returns the value of attribute authn_context.
10 11 12 |
# File 'lib/spid/saml2/settings.rb', line 10 def authn_context @authn_context end |
#identity_provider ⇒ Object (readonly)
Returns the value of attribute identity_provider.
8 9 10 |
# File 'lib/spid/saml2/settings.rb', line 8 def identity_provider @identity_provider end |
#service_provider ⇒ Object (readonly)
Returns the value of attribute service_provider.
9 10 11 |
# File 'lib/spid/saml2/settings.rb', line 9 def service_provider @service_provider end |
Instance Method Details
#acs_index ⇒ Object
87 88 89 |
# File 'lib/spid/saml2/settings.rb', line 87 def acs_index "0" end |
#certificate ⇒ Object
71 72 73 |
# File 'lib/spid/saml2/settings.rb', line 71 def certificate service_provider.certificate end |
#digest_method ⇒ Object
83 84 85 |
# File 'lib/spid/saml2/settings.rb', line 83 def digest_method service_provider.digest_method end |
#force_authn? ⇒ Boolean
91 92 93 |
# File 'lib/spid/saml2/settings.rb', line 91 def force_authn? authn_context > Spid::L1 end |
#idp_certificate ⇒ Object
75 76 77 |
# File 'lib/spid/saml2/settings.rb', line 75 def idp_certificate identity_provider.certificate end |
#idp_entity_id ⇒ Object
31 32 33 |
# File 'lib/spid/saml2/settings.rb', line 31 def idp_entity_id identity_provider.entity_id end |
#idp_slo_target_url ⇒ Object
39 40 41 |
# File 'lib/spid/saml2/settings.rb', line 39 def idp_slo_target_url identity_provider.slo_target_url end |
#idp_sso_target_url ⇒ Object
35 36 37 |
# File 'lib/spid/saml2/settings.rb', line 35 def idp_sso_target_url identity_provider.sso_target_url end |
#private_key ⇒ Object
67 68 69 |
# File 'lib/spid/saml2/settings.rb', line 67 def private_key service_provider.private_key end |
#signature_method ⇒ Object
79 80 81 |
# File 'lib/spid/saml2/settings.rb', line 79 def signature_method service_provider.signature_method end |
#sp_acs_binding ⇒ Object
51 52 53 |
# File 'lib/spid/saml2/settings.rb', line 51 def sp_acs_binding service_provider.acs_binding end |
#sp_acs_url ⇒ Object
47 48 49 |
# File 'lib/spid/saml2/settings.rb', line 47 def sp_acs_url service_provider.acs_url end |
#sp_attribute_services ⇒ Object
63 64 65 |
# File 'lib/spid/saml2/settings.rb', line 63 def sp_attribute_services service_provider.attribute_services end |
#sp_entity_id ⇒ Object
43 44 45 |
# File 'lib/spid/saml2/settings.rb', line 43 def sp_entity_id service_provider.host end |
#sp_slo_service_binding ⇒ Object
59 60 61 |
# File 'lib/spid/saml2/settings.rb', line 59 def sp_slo_service_binding service_provider.slo_binding end |
#sp_slo_service_url ⇒ Object
55 56 57 |
# File 'lib/spid/saml2/settings.rb', line 55 def sp_slo_service_url service_provider.slo_url end |
#x509_certificate_der ⇒ Object
95 96 97 98 99 100 |
# File 'lib/spid/saml2/settings.rb', line 95 def x509_certificate_der @x509_certificate_der ||= begin Base64.encode64(certificate.to_der).delete("\n") end end |