【问题标题】:Unsafe redirect when running Ruby On Rails app (with Devise and SAML )on localhost在 localhost 上运行 Ruby On Rails 应用程序(使用 Devise 和 SAML)时重定向不安全
【发布时间】:2022-01-17 16:42:17
【问题描述】:

我有一个使用 Devise 和 devise_saml_authenticable gem 的 Ruby On Rails 应用程序(Ruby 3.1、Rails 7.0.1),因为我对 Microsoft Azure Active Directory 进行身份验证。

从 Ruby 2.7.4 和 Rails 6.1.x 升级我的应用程序后,我收到以下错误:

ActionController::Redirecting::UnsafeRedirectError in Devise::SamlSessionsController#new

Unsafe redirect to "https://login.microsoftonline.com/ba06cbf3-c661-4896-8dbc- 
cd190052c299/saml2?SAMLRequest=fVJNa9ww...", pass allow_other_host: true to redirect anyway.

仅当我在本地(使用 HTTPS)运行我的应用程序时才会出现此错误:

bundle exec rails s -e development -b "ssl://0.0.0.0:3000?key=./config/ssl/localhost.key&cert=./config/ssl/localhost.crt"

但是当我在我的服务器上运行应用程序时不会发生错误。

【问题讨论】:

    标签: ruby-on-rails devise saml


    【解决方案1】:

    问题已解决,今天的捆绑包更新为 devise_saml_authenticable (v1.8.0) 提供了 GEM 更新,现在错误消失了。

    【讨论】:

      猜你喜欢
      • 2020-09-18
      • 1970-01-01
      • 2012-12-01
      • 1970-01-01
      • 2012-05-27
      • 2021-11-20
      • 2011-12-08
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多