oauth2_database.rb 369 B

1234567891011121314
  1. class Oauth2Database < OmniAuth::Strategies::OAuth2
  2. option :name, 'oauth2'
  3. def initialize(app, *args, &block)
  4. # database lookup
  5. config = Setting.get('auth_oauth2_credentials') || {}
  6. args[0] = config['app_id']
  7. args[1] = config['app_secret']
  8. args[2][:client_options] = args[2][:client_options].merge(config.symbolize_keys)
  9. super
  10. end
  11. end