Class: OmniAuth::Strategies::MPASSid
- Inherits:
-
SAML
- Object
- SAML
- OmniAuth::Strategies::MPASSid
- Defined in:
- lib/omniauth/strategies/mpassid.rb
Instance Method Summary collapse
-
#callback_url ⇒ Object
Override the callback URL so that it always matches the one expected by MPASSid.
-
#initialize(app, *args, &block) ⇒ MPASSid
constructor
A new instance of MPASSid.
-
#request_phase ⇒ Object
Override the request phase to be able to pass the lang parameter to the redirect URL.
-
#response_object ⇒ Object
This method can be used externally to fetch information about the response, e.g.
Constructor Details
#initialize(app, *args, &block) ⇒ MPASSid
Returns a new instance of MPASSid.
248 249 250 251 252 253 254 255 256 257 258 |
# File 'lib/omniauth/strategies/mpassid.rb', line 248 def initialize(app, *args, &block) super # Add the MPASSid options to the local options, most of which are # fetched from the metadata. The options array is the one that gets # priority in case it overrides some of the metadata or locally defined # option values. = OmniAuth::Strategy::Options.new( .merge() ) end |
Instance Method Details
#callback_url ⇒ Object
Override the callback URL so that it always matches the one expected by MPASSid. No additional query string parameters can be included in the string.
292 293 294 |
# File 'lib/omniauth/strategies/mpassid.rb', line 292 def callback_url full_host + script_name + callback_path end |
#request_phase ⇒ Object
Override the request phase to be able to pass the lang parameter to the redirect URL. Note that this needs to be the last parameter to be passed to the redirect URL.
263 264 265 266 267 268 269 270 271 272 |
# File 'lib/omniauth/strategies/mpassid.rb', line 263 def request_phase authn_request = OneLogin::RubySaml::Authrequest.new lang = lang_for_authn_request with_settings do |settings| url = authn_request.create(settings, additional_params_for_authn_request) url += "&lang=#{CGI.escape(lang)}" unless lang.nil? redirect(url) end end |
#response_object ⇒ Object
This method can be used externally to fetch information about the response, e.g. in case of failures.
276 277 278 279 280 281 282 283 284 285 286 287 |
# File 'lib/omniauth/strategies/mpassid.rb', line 276 def response_object return nil unless request.params['SAMLResponse'] with_settings do |settings| response = OneLogin::RubySaml::Response.new( request.params['SAMLResponse'], .merge(settings: settings) ) response.attributes['fingerprint'] = settings.idp_cert_fingerprint response end end |