【问题标题】:Rails Devise Omniauth omniauth_openid_connect issue; Always getting `Not found. Authentication passthru`Rails 设计 Omniauth omniauth_openid_connect 问题;总是得到`未找到。身份验证通道`
【发布时间】:2019-04-11 04:27:24
【问题描述】:

很抱歉,如果我遗漏了一些非常基本的东西,但我认为我需要一些帮助来在我的应用程序中配置 omniauth_openid_connect gem (https://github.com/m0n9oose/omniauth_openid_connect/);我总是收到Not found. Authentication passthru。错误;

点击“使用 OpenIdConnect 登录”后设计的网址是: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)

我还有客户 ID 和密码

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

【问题讨论】:

    标签: ruby-on-rails devise omniauth openid-connect


    【解决方案1】:

    正确的配置:

    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", 
        }, 
      }
    

    【讨论】:

    • 您介意分享设计控制器和回调的样板吗?
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-01-30
    • 1970-01-01
    • 2021-09-21
    • 2017-05-10
    • 1970-01-01
    • 2017-10-22
    • 2017-08-16
    相关资源
    最近更新 更多