【发布时间】: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