omniauth / omniauth_openid_connect

MIT License
165 stars 187 forks source link

multiple open_id providers with devise #115

Open masciugo opened 2 years ago

masciugo commented 2 years ago

The doc says:

NOTE: if you use this gem with Devise you should use :openid_connect name, or Devise would route to 'users/auth/:provider' rather than 'users/auth/openid_connect'

this means that I cannot use more openid providers when using Devise?

thank you

ssoulless commented 2 years ago

There should be hints here: https://github.com/betagouv/civilsdeladefense/pull/782

Not sure how they make it work since they use devise and also use custom name provider

JeanSebTr commented 1 year ago

You can have however many providers you'd like (we have 3). In config/initializers/devise.rb :

config.omniauth(
    :openid_connect,
    name: :your_provider_name,
    issuer: YOUR_PROVIDER_ISSUER_URL,
    discovery: true,
    # other options you may need
    client_options: {
      identifier: YOUR_CLIENT_ID,
      secret: YOUR_CLIENT_SECRET,
    },
  )

This will use the name option to route to /users/auth/:provider like /users/auth/your_provider_name