linked_in_database.rb 625 B

12345678910111213141516171819202122
  1. # Copyright (C) 2012-2024 Zammad Foundation, https://zammad-foundation.org/
  2. class OmniAuth::Strategies::LinkedInDatabase < OmniAuth::Strategies::LinkedIn
  3. option :name, 'linkedin'
  4. def initialize(app, *args, &)
  5. # database lookup
  6. config = Setting.get('auth_linkedin_credentials') || {}
  7. args[0] = config['app_id']
  8. args[1] = config['app_secret']
  9. super
  10. end
  11. # Workaround from current omniauth-linkedin gem issue:
  12. # https://github.com/decioferreira/omniauth-linkedin-oauth2/issues/68
  13. def token_params
  14. super.tap do |params|
  15. params.client_secret = options.client_secret
  16. end
  17. end
  18. end