Add new omniauth provider

Infos:

  • Used Zammad version: 3.1.0
  • Used Zammad installation source: source
  • Operating system: Mac OS X (Mojave)
  • Browser + version: Chrome 76.0.3809.100

Expected behavior:

I tried to add support for the omniauth module “cas” (see https://github.com/dlindahl/omniauth-cas).
So I did the following:

  • create vendor/lib/cas_database.rb (which extends OmniAuth::Strategies::CAS)
  • add config/initializers/omniauth_cas.rb to configure it
  • added form “auth_cas” and “auth_cas_credentials” to the object store

The form worked, and Setting.get(“auth_cas”) returned “true” when it was set in the admin interface.

But there was no extra button in the login screen.

After digging around, I discovered that the auth_providers are hardcoded in
app/assets/javascripts/app/controllers/_profile/linked_accounts.coffee (see
App.Config.set(“auth_provider_all”) at the bottom.

Then everything started to work!

But the way I had to set the option “auth_provider_all” in the coffeescript was
a bit hacky for me. Is there a better way?

I can always add this as a PR to the main source on github, but I guess one cannot accept
all kinds of SSO features …

Actual behavior:

Steps to reproduce the behavior:

Maybe @thorsteneckel can help better here.
Also, I changed the category to Development, because I think it fits better. :slight_smile:

Great seeing people hack around here. :open_mouth:

Hi @njfranck - you can add a new omniauth provider like e.g. this: https://github.com/zammad/zammad/commit/336ac678984cb6b3057430c93364bb1c090018bd

Please note that we currently take any new providers to the core (via Pull Requests etc.) because of the increased maintenance. We think that the existing providers cover the need of 80% and more of our user base. Thanks for your understanding.