You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am working on a project that needs to allow for organizations to configure their own google oauth integration for SSO. Looking through documentation and code, it didn't seem that this is yet supported out of the box. I was able to achieve it with a simple module and including it into OmniAuth::Strategies::GoogeOauth2 in my devise.rb initializer prior to loading it:
# config/initializers/devise.rb
module GoogleOmniAuthProviderCustomization
def self.included(klass)
klass.option :tenant_provider, nil
end
def client
provider = if options.tenant_provider.class.is_a?(Class)
options.tenant_provider.new(self)
else
options
end
options.client_id = provider.client_id
options.client_secret = provider.client_secret
super
end
end
OmniAuth::Strategies::GoogleOauth2.include(GoogleOmniAuthProviderCustomization)
Devise.setup do |config|
...
config.omniauth :google_oatuh2, tenant_provider: MyCustomGoogleProvider
...
end
If this is something that you feel would be of value I'm happy to submit a PR to extend the current functionality. Thanks for your time.
The text was updated successfully, but these errors were encountered:
Hello,
I am working on a project that needs to allow for organizations to configure their own google oauth integration for SSO. Looking through documentation and code, it didn't seem that this is yet supported out of the box. I was able to achieve it with a simple module and including it into
OmniAuth::Strategies::GoogeOauth2
in mydevise.rb
initializer prior to loading it:If this is something that you feel would be of value I'm happy to submit a PR to extend the current functionality. Thanks for your time.
The text was updated successfully, but these errors were encountered: