The code for adding a new Oauth provider is currently modular, but those modules currently have to reside within the core code. We should modify the code so that this can be added as a plugin (or configurable json file), per comment from @michbarsinai on #4334:
"Creating a completely general OAuth2 client would be nice, but OAuth2 is very permissive, so there's a lot of variance between providers. Even ScribeJava ended up writing multiple clients, one-per-service. It may be possible to generalize a bit, though, in the same manner we did with the REST-based workflow step.
Another option is to open the OAuth2 providers as a plug-in area. This way, the Dataporten OAuth2 client will be developed as a plug-in, and so there won't be a need to maintain a fork."