Class: OmniAuth::Strategies::SAML_RSTR::AuthResponse
- Inherits:
-
Object
- Object
- OmniAuth::Strategies::SAML_RSTR::AuthResponse
- Defined in:
- lib/omniauth/strategies/saml-rstr/auth_response.rb
Constant Summary collapse
- ASSERTION =
"urn:oasis:names:tc:SAML:2.0:assertion"
- PROTOCOL =
"urn:oasis:names:tc:SAML:2.0:protocol"
- DSIG =
"http://www.w3.org/2000/09/xmldsig#"
Instance Attribute Summary collapse
-
#options ⇒ Object
Returns the value of attribute options.
-
#response ⇒ Object
Returns the value of attribute response.
-
#security_token_content ⇒ Object
Returns the value of attribute security_token_content.
-
#settings ⇒ Object
Returns the value of attribute settings.
Instance Method Summary collapse
-
#attributes ⇒ Object
A hash of all the attributes with the response.
-
#conditions ⇒ Object
Conditions (if any) for the assertion to run.
-
#initialize(response, options = {}) ⇒ AuthResponse
constructor
A new instance of AuthResponse.
-
#name_id ⇒ Object
The value of the user identifier as designated by the initialization request response.
-
#session_expires_at ⇒ Object
When this user session should expire at latest.
- #valid? ⇒ Boolean
- #validate! ⇒ Object
Constructor Details
#initialize(response, options = {}) ⇒ AuthResponse
Returns a new instance of AuthResponse.
14 15 16 17 18 19 |
# File 'lib/omniauth/strategies/saml-rstr/auth_response.rb', line 14 def initialize(response, = {}) raise ArgumentError.new("Response cannot be nil") if response.nil? self. = self.response = response self.security_token_content = OmniAuth::Strategies::SAML_RSTR::XMLSecurity::SecurityTokenResponseContent.new(response) end |
Instance Attribute Details
#options ⇒ Object
Returns the value of attribute options.
12 13 14 |
# File 'lib/omniauth/strategies/saml-rstr/auth_response.rb', line 12 def @options end |
#response ⇒ Object
Returns the value of attribute response.
12 13 14 |
# File 'lib/omniauth/strategies/saml-rstr/auth_response.rb', line 12 def response @response end |
#security_token_content ⇒ Object
Returns the value of attribute security_token_content.
12 13 14 |
# File 'lib/omniauth/strategies/saml-rstr/auth_response.rb', line 12 def security_token_content @security_token_content end |
#settings ⇒ Object
Returns the value of attribute settings.
12 13 14 |
# File 'lib/omniauth/strategies/saml-rstr/auth_response.rb', line 12 def settings @settings end |
Instance Method Details
#attributes ⇒ Object
A hash of all the attributes with the response. Assuming there is only one value for each key
35 36 37 |
# File 'lib/omniauth/strategies/saml-rstr/auth_response.rb', line 35 def attributes { :userEmailID => @security_token_content.name_identifier} end |
#conditions ⇒ Object
Conditions (if any) for the assertion to run
47 48 49 50 51 52 53 54 |
# File 'lib/omniauth/strategies/saml-rstr/auth_response.rb', line 47 def conditions @conditions ||= begin { :before => security_token_content.conditions_before, :not_on_or_after => security_token_content.conditions_not_on_or_after } end end |
#name_id ⇒ Object
The value of the user identifier as designated by the initialization request response
30 31 32 |
# File 'lib/omniauth/strategies/saml-rstr/auth_response.rb', line 30 def name_id @security_token_content.name_identifier end |
#session_expires_at ⇒ Object
When this user session should expire at latest
40 41 42 43 44 |
# File 'lib/omniauth/strategies/saml-rstr/auth_response.rb', line 40 def session_expires_at @expires_at ||= begin parse_time(security_token_content.conditions_not_on_or_after) end end |
#valid? ⇒ Boolean
21 22 23 |
# File 'lib/omniauth/strategies/saml-rstr/auth_response.rb', line 21 def valid? validate(soft = true) end |
#validate! ⇒ Object
25 26 27 |
# File 'lib/omniauth/strategies/saml-rstr/auth_response.rb', line 25 def validate! validate(soft = false) end |