Skip to content
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

Sign_out request causes unsafe redirect error for Rails 7+ #237

Open
Taeir opened this issue Jul 17, 2023 · 1 comment
Open

Sign_out request causes unsafe redirect error for Rails 7+ #237

Taeir opened this issue Jul 17, 2023 · 1 comment

Comments

@Taeir
Copy link

Taeir commented Jul 17, 2023

In Rails 7, a setting was changed/introduced for by default disallowing redirects to external locations, unless if allow_other_host: true is passed to the redirect_to call.

When the name identifier format is set to transient, devise_saml_authenticatable will redirect a user to do a SLO request at the IDP, which is an external host (in most cases). This is set as the after_sign_out_path_for for the user. However, the method that does the redirect (I believe Devise::SessionsController#respond_to_on_destroy) does not pass allow_other_host, so Rails 7 and up will raise an UnsafeRedirectError in this case.

@adamstegman
Copy link
Collaborator

Great catch! It looks like heartcombo/devise#5462 is looking into this in devise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants