Class: SamlIdp::AssertionBuilder
- Inherits:
-
Object
- Object
- SamlIdp::AssertionBuilder
- Includes:
- Algorithmable, Signable
- Defined in:
- lib/saml_idp/assertion_builder.rb
Instance Attribute Summary collapse
-
#audience_uri ⇒ Object
Returns the value of attribute audience_uri.
-
#authn_context_classref ⇒ Object
Returns the value of attribute authn_context_classref.
-
#encryption_opts ⇒ Object
Returns the value of attribute encryption_opts.
-
#expiry ⇒ Object
Returns the value of attribute expiry.
-
#issuer_uri ⇒ Object
Returns the value of attribute issuer_uri.
-
#principal ⇒ Object
Returns the value of attribute principal.
-
#raw_algorithm ⇒ Object
Returns the value of attribute raw_algorithm.
-
#reference_id ⇒ Object
Returns the value of attribute reference_id.
-
#saml_acs_url ⇒ Object
Returns the value of attribute saml_acs_url.
-
#saml_request_id ⇒ Object
Returns the value of attribute saml_request_id.
Instance Method Summary collapse
- #encrypt(opts = {}) ⇒ Object
-
#initialize(reference_id, issuer_uri, principal, audience_uri, saml_request_id, saml_acs_url, raw_algorithm, authn_context_classref, expiry = 60*60, encryption_opts = nil) ⇒ AssertionBuilder
constructor
A new instance of AssertionBuilder.
Methods included from Signable
Constructor Details
#initialize(reference_id, issuer_uri, principal, audience_uri, saml_request_id, saml_acs_url, raw_algorithm, authn_context_classref, expiry = 60*60, encryption_opts = nil) ⇒ AssertionBuilder
Returns a new instance of AssertionBuilder.
21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/saml_idp/assertion_builder.rb', line 21 def initialize(reference_id, issuer_uri, principal, audience_uri, saml_request_id, saml_acs_url, raw_algorithm, authn_context_classref, expiry=60*60, encryption_opts=nil) self.reference_id = reference_id self.issuer_uri = issuer_uri self.principal = principal self.audience_uri = audience_uri self.saml_request_id = saml_request_id self.saml_acs_url = saml_acs_url self.raw_algorithm = raw_algorithm self.authn_context_classref = authn_context_classref self.expiry = expiry self.encryption_opts = encryption_opts end |
Instance Attribute Details
#audience_uri ⇒ Object
Returns the value of attribute audience_uri.
11 12 13 |
# File 'lib/saml_idp/assertion_builder.rb', line 11 def audience_uri @audience_uri end |
#authn_context_classref ⇒ Object
Returns the value of attribute authn_context_classref.
15 16 17 |
# File 'lib/saml_idp/assertion_builder.rb', line 15 def authn_context_classref @authn_context_classref end |
#encryption_opts ⇒ Object
Returns the value of attribute encryption_opts.
17 18 19 |
# File 'lib/saml_idp/assertion_builder.rb', line 17 def encryption_opts @encryption_opts end |
#expiry ⇒ Object
Returns the value of attribute expiry.
16 17 18 |
# File 'lib/saml_idp/assertion_builder.rb', line 16 def expiry @expiry end |
#issuer_uri ⇒ Object
Returns the value of attribute issuer_uri.
9 10 11 |
# File 'lib/saml_idp/assertion_builder.rb', line 9 def issuer_uri @issuer_uri end |
#principal ⇒ Object
Returns the value of attribute principal.
10 11 12 |
# File 'lib/saml_idp/assertion_builder.rb', line 10 def principal @principal end |
#raw_algorithm ⇒ Object
Returns the value of attribute raw_algorithm.
14 15 16 |
# File 'lib/saml_idp/assertion_builder.rb', line 14 def raw_algorithm @raw_algorithm end |
#reference_id ⇒ Object
Returns the value of attribute reference_id.
8 9 10 |
# File 'lib/saml_idp/assertion_builder.rb', line 8 def reference_id @reference_id end |
#saml_acs_url ⇒ Object
Returns the value of attribute saml_acs_url.
13 14 15 |
# File 'lib/saml_idp/assertion_builder.rb', line 13 def saml_acs_url @saml_acs_url end |
#saml_request_id ⇒ Object
Returns the value of attribute saml_request_id.
12 13 14 |
# File 'lib/saml_idp/assertion_builder.rb', line 12 def saml_request_id @saml_request_id end |
Instance Method Details
#encrypt(opts = {}) ⇒ Object
83 84 85 86 87 88 89 |
# File 'lib/saml_idp/assertion_builder.rb', line 83 def encrypt(opts = {}) raise "Must set encryption_opts to encrypt" unless encryption_opts raw_xml = opts[:sign] ? signed : raw require 'saml_idp/encryptor' encryptor = Encryptor.new encryption_opts encryptor.encrypt(raw_xml) end |