-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to pass OneLogin::RubySaml::Response configuration options? #197
Comments
We pass in a Here's where the response is constructed:
|
I ended up having to monkeypatch for |
Yeah, if you want to create a PR that would make sense to me! |
@arcreative Can u elaborate on how did you implement the patch? Where do u store it? I will probably need to patch adevise_saml_authenticatable/lib/devise_saml_authenticatable/strategy.rb#response_options as @adamstegman mentioned but I can't make it work. |
I don't know if this is the best, but it's working for me: # lib/devise/extensions/saml_response_options.rb
require 'devise_saml_authenticatable/strategy'
module Devise
module Extensions
module SamlResponseOptions
def response_options
super.merge(skip_audience: true, skip_recipient_check: true)
end
end
end
end # config/initializers/devise.rb
# Monkey Patch Devise::Strategies::SamlAuthenticatable to skip audience validation in test env
if Rails.env.test?
require 'devise/extensions/saml_response_options'
Devise::Strategies::SamlAuthenticatable.prepend Devise::Extensions::SamlResponseOptions
end UPDATE: This actually wasn't working until I switched |
@jaredmoody Thanks! I was having the same problem and your solution worked perfectly for me. |
In the doc: https://github.com/onelogin/ruby-saml
I'm not sure how to for example set
skip_subject_confirmation
throughdevise_saml_authenticatable
any guidance is welcome.Regards
The text was updated successfully, but these errors were encountered: