簡體   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