Class: Saml2::Type4Artifact
- Inherits:
-
Object
- Object
- Saml2::Type4Artifact
- Defined in:
- lib/saml2/type4_artifact.rb
Instance Attribute Summary collapse
-
#endpoint_index ⇒ Object
readonly
Returns the value of attribute endpoint_index.
-
#message_handle ⇒ Object
readonly
Returns the value of attribute message_handle.
-
#source_id ⇒ Object
readonly
Returns the value of attribute source_id.
Class Method Summary collapse
-
.new_from_string(artifact_string) ⇒ Saml2::Type4Artifact
Parse an type 4 SAML 2.0 artifact such as one received in a ‘SAMLart` HTTP request parameter as part of a HTTP artifact binding SSO handshake.
Instance Method Summary collapse
-
#initialize(endpoint_index, source_id, message_handle) ⇒ Type4Artifact
constructor
A new instance of Type4Artifact.
-
#resolve ⇒ Saml2::Assertion
Resolve the artifact into an Assertion.
-
#to_s ⇒ String
Base64 encoded version of self.
-
#type_code ⇒ Object
The type code of this artifact.
Constructor Details
#initialize(endpoint_index, source_id, message_handle) ⇒ Type4Artifact
Returns a new instance of Type4Artifact.
25 26 27 28 29 |
# File 'lib/saml2/type4_artifact.rb', line 25 def initialize(endpoint_index, source_id, ) @endpoint_index = endpoint_index @source_id = source_id @message_handle = end |
Instance Attribute Details
#endpoint_index ⇒ Object (readonly)
Returns the value of attribute endpoint_index.
6 7 8 |
# File 'lib/saml2/type4_artifact.rb', line 6 def endpoint_index @endpoint_index end |
#message_handle ⇒ Object (readonly)
Returns the value of attribute message_handle.
6 7 8 |
# File 'lib/saml2/type4_artifact.rb', line 6 def @message_handle end |
#source_id ⇒ Object (readonly)
Returns the value of attribute source_id.
6 7 8 |
# File 'lib/saml2/type4_artifact.rb', line 6 def source_id @source_id end |
Class Method Details
.new_from_string(artifact_string) ⇒ Saml2::Type4Artifact
Parse an type 4 SAML 2.0 artifact such as one received in a ‘SAMLart` HTTP request parameter as part of a HTTP artifact binding SSO handshake.
15 16 17 18 19 20 21 22 23 |
# File 'lib/saml2/type4_artifact.rb', line 15 def self.new_from_string(artifact_string) unencoded_artifact = Base64.decode64 artifact_string type_code, *rest = unencoded_artifact.unpack('nna20a20') raise UnexpectedTypeCodeError.new("Incorrect artifact type (expected type code 4 but found #{type_code}") unless type_code == 4 new *rest end |
Instance Method Details
#resolve ⇒ Saml2::Assertion
Resolve the artifact into an Assertion
45 46 47 |
# File 'lib/saml2/type4_artifact.rb', line 45 def resolve Saml2::ArtifactResolver(source_id).resolve(self) end |
#to_s ⇒ String
Returns base64 encoded version of self.
37 38 39 |
# File 'lib/saml2/type4_artifact.rb', line 37 def to_s Base64.encode64([4, endpoint_index, source_id, ].pack('nna20a20')).strip end |
#type_code ⇒ Object
The type code of this artifact
32 33 34 |
# File 'lib/saml2/type4_artifact.rb', line 32 def type_code 4 end |