"Not found. Authentication passthru(Azure)" 在 Rails

"Not found. Authentication passthru(Azure)" in Rails

当我尝试使用 Azure Id 登录时出现“未找到。身份验证直通 (Azure)”错误 option.Can 请帮助解决此问题?

我目前收到以下错误:未找到。身份验证直通。

伴随着:

Url: http://localhost:3000/users/auth/azure_activedirectory_v2

Started GET "/users/auth/azure_activedirectory_v2" for ::1 at 2021-02-16 07:15:51 +0000
Processing by Users::OmniauthCallbacksController#passthru as HTML
  Rendered text template (0.0ms)

路线:

devise_for :users,
                  
                 controllers: {
                    sessions:           'users/sessions',
                    omniauth_callbacks: 'users/omniauth_callbacks'
                  }

下面gem我用的是:

gem 'omniauth-azure-activedirectory-v2'

初始化器配置

Devise.setup do |config|

  config.omniauth :azure_activedirectory_v2,
                  client_id:     ENV['AZURE_CLIENT_ID'],
                  client_secret: ENV['AZURE_CLIENT_SECRET'],
                  tenant_id:     ENV['AZURE_TENANT_ID'],

我通过如下更新 gem 文件解决了问题。

gem 'omniauth', '~> 1.6', '>= 1.6.1'