refactored OAuth to OAuth2. added support for client_credentials flow