Class: Spid::Sso::Request
- Inherits:
-
Object
- Object
- Spid::Sso::Request
- Defined in:
- lib/spid/sso/request.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.
-
#authn_context_comparison ⇒ Object
readonly
Returns the value of attribute authn_context_comparison.
-
#idp_name ⇒ Object
readonly
Returns the value of attribute idp_name.
-
#relay_state ⇒ Object
readonly
Returns the value of attribute relay_state.
Instance Method Summary collapse
- #authn_request ⇒ Object
- #identity_provider ⇒ Object
-
#initialize(idp_name:, attribute_index:, relay_state: nil, authn_context: nil) ⇒ Request
constructor
A new instance of Request.
- #query_params_signer ⇒ Object
- #saml_message ⇒ Object
- #service_provider ⇒ Object
- #settings ⇒ Object
- #url ⇒ Object
- #uuid ⇒ Object
Constructor Details
#initialize(idp_name:, attribute_index:, relay_state: nil, authn_context: nil) ⇒ Request
Returns a new instance of Request.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/spid/sso/request.rb', line 12 def initialize( idp_name:, attribute_index:, relay_state: nil, authn_context: nil ) @idp_name = idp_name @relay_state = relay_state @authn_context = authn_context || Spid::L1 @attribute_index = attribute_index @relay_state = begin relay_state || Spid.configuration.default_relay_state_path end end |
Instance Attribute Details
#attribute_index ⇒ Object (readonly)
Returns the value of attribute attribute_index.
8 9 10 |
# File 'lib/spid/sso/request.rb', line 8 def attribute_index @attribute_index end |
#authn_context ⇒ Object (readonly)
Returns the value of attribute authn_context.
9 10 11 |
# File 'lib/spid/sso/request.rb', line 9 def authn_context @authn_context end |
#authn_context_comparison ⇒ Object (readonly)
Returns the value of attribute authn_context_comparison.
10 11 12 |
# File 'lib/spid/sso/request.rb', line 10 def authn_context_comparison @authn_context_comparison end |
#idp_name ⇒ Object (readonly)
Returns the value of attribute idp_name.
6 7 8 |
# File 'lib/spid/sso/request.rb', line 6 def idp_name @idp_name end |
#relay_state ⇒ Object (readonly)
Returns the value of attribute relay_state.
7 8 9 |
# File 'lib/spid/sso/request.rb', line 7 def relay_state @relay_state end |
Instance Method Details
#authn_request ⇒ Object
55 56 57 |
# File 'lib/spid/sso/request.rb', line 55 def authn_request @authn_request ||= Spid::Saml2::AuthnRequest.new(settings: settings) end |
#identity_provider ⇒ Object
68 69 70 71 |
# File 'lib/spid/sso/request.rb', line 68 def identity_provider @identity_provider ||= IdentityProviderManager.find_by_entity(idp_name) end |
#query_params_signer ⇒ Object
39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/spid/sso/request.rb', line 39 def query_params_signer @query_params_signer ||= begin Spid::Saml2::Utils::QueryParamsSigner.new( saml_message: , relay_state: relay_state, private_key: settings.private_key, signature_method: settings.signature_method ) end end |
#saml_message ⇒ Object
51 52 53 |
# File 'lib/spid/sso/request.rb', line 51 def @saml_message ||= authn_request.to_saml end |
#service_provider ⇒ Object
73 74 75 76 |
# File 'lib/spid/sso/request.rb', line 73 def service_provider @service_provider ||= Spid.configuration.service_provider end |
#settings ⇒ Object
59 60 61 62 63 64 65 66 |
# File 'lib/spid/sso/request.rb', line 59 def settings @settings ||= Spid::Saml2::Settings.new( identity_provider: identity_provider, service_provider: service_provider, authn_context: authn_context, attribute_index: attribute_index ) end |
#url ⇒ Object
28 29 30 31 32 33 |
# File 'lib/spid/sso/request.rb', line 28 def url [ settings.idp_sso_target_url, query_params_signer.escaped_signed_query_string ].join("?") end |
#uuid ⇒ Object
35 36 37 |
# File 'lib/spid/sso/request.rb', line 35 def uuid authn_request.uuid end |