omniauth / omniauth_openid_connect

MIT License
165 stars 187 forks source link

how to work with endpoints with different hosts but same provider #120

Open ssoulless opened 2 years ago

ssoulless commented 2 years ago

I have two endpoints one for Authorization and another for token:

Authorization endpoint: https://oauth.provider.com/authorize

Token endpoint: https://oauth-secured.provider.com/token

as you can see each one has a different host, but are the same provider, I'm not sure how to configure this in the gem as you can only specify one host:

config.omniauth :openid_connect, 
{ 
    name: :openid_connect,
    scope: [:openid],
    issuer: "oauth.provider.com"
    response_type: :code,
    discovery: :true,
    client_options:
    {
    port: 443,
    scheme: "https",
    host: "oauth.provider.com",
    authorization_endpoint: "/authorize", 
    token_endpoint: "/token", #How to specify here correctly https://oauth-secured.provider.com/token
    identifier: 'CLIENT_ID', 
    secret: 'CLIENT_SECRET', 
    redirect_uri: "https://myapp.com/users/auth/openid_connect/callback", 
    }, 
  }
ssoulless commented 2 years ago

possible workaround here

stanhu commented 1 year ago

This note might be relevant: https://gitlab.com/gitlab-org/omnibus-gitlab/-/issues/5992#note_531363944

phyzalis commented 1 year ago

I have facing the same issue.

When I try to set an absolute URI in token_endpoint I have this error

Authentication failure! Request URI must have schema. Possibly add 'http://' to the request URI?: ArgumentError, Request URI must have schema. Possibly add 'http://' to the request URI?

I've had a look at both answers but I am not technically able to implement the first and the second seems to be related to different providers, which is not what we need.