繁体   English   中英

Rails Devise Omniauth omniauth_openid_connect问题; 总是得到`未找到。 验证通过

[英]Rails Devise Omniauth omniauth_openid_connect issue; Always getting `Not found. Authentication passthru`

很抱歉,如果我缺少一些非常基本的东西,但是我想在我的应用程序中通过omniauth_openid_connect配置omniauth_openid_connect gem( https://github.com/m0n9oose/omniauth_openid_connect/ )时需要一些帮助; 我总是越来越Not found. Authentication passthru Not found. Authentication passthru 错误;

单击“使用OpenIdConnect登录”时设计的url为: https ://myapp.com/users/auth/openid_connect

我的配置如下所示在config/initializers/devise.rb

config.omniauth :openid_connect, 
{ 
    name: :openid_connect,
    scope: [:openid],
    response_type: :code,
    client_options:
    {
    port: 443,
    scheme: "https",
    host: "staging-oauth.provider.com",
    issuer: "https://staging-oauth.provider.com",
    authorization_endpoint: "/oauth2/auth", 
    token_endpoint: "/oauth2/token", 
    identifier: 'CLIENT_ID', 
    secret: 'CLIENT_SECRET', 
    redirect_uri: "https://myapp.com/users/auth/openid_connect/callback", 
    }, 
    }

我知道我已经在其中添加了额外的参数,但这是因为我不确定到底需要什么。 我也看不到服务器上的任何日志,所以这意味着我没有击中正确的端点或其他东西

我有以下提供商提供的网址

发行者端点( https://staging-oauth.provider.com

授权端点( https://staging-oauth.provider.com/oauth2/auth

令牌端点( https://staging-oauth.provider.com/oauth2/token

我也有客户编号和秘密

在这方面的任何帮助将不胜感激!

正确的配置:

config.omniauth :openid_connect, 
{ 
    name: :openid_connect,
    scope: [:openid],
    issuer: "https://staging-oauth.provider.com/"
    response_type: :code,
    discovery: :true,
    client_options:
    {
    port: 443,
    scheme: "https",
    host: "staging-oauth.provider.com",
    authorization_endpoint: "/oauth2/auth", 
    token_endpoint: "/oauth2/token", 
    identifier: 'CLIENT_ID', 
    secret: 'CLIENT_SECRET', 
    redirect_uri: "https://myapp.com/users/auth/openid_connect/callback", 
    }, 
  }

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM