Refactor oauth and oauth2 providers

I cleaned oauth and oauth2 providers a bit to reduce a duplication.
I'm also watching to tests, but it seems oauth providers are not covered by the tests...