简体   繁体   中英

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

sorry if I am missing something very basic but I think I need some help in configuring omniauth_openid_connect gem ( https://github.com/m0n9oose/omniauth_openid_connect/ ) with devise in my application; I am always getting Not found. Authentication passthru Not found. Authentication passthru . error;

The url that devise upon clicking 'Sign In with OpenIdConnect' goes to is: https://myapp.com/users/auth/openid_connect

My config looks like below in 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", 
    }, 
    }

I know I have added extra parameters in it but that's because I'm unsure of what exactly is required; I cant see any logs on the server as well so it means I am not hitting the correct endpoint or something

I have the following urls from provider available

issuer endpoint ( https://staging-oauth.provider.com )

authorization endpoint ( https://staging-oauth.provider.com/oauth2/auth )

token endpoint ( https://staging-oauth.provider.com/oauth2/token )

also I have the client id and secret

Any help in this regard would be highly appreciated !!

The correct config:

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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