inveniosoftware / invenio-oauthclient

Invenio module that provides OAuth web authorization support.
https://invenio-oauthclient.readthedocs.io
MIT License
6 stars 74 forks source link

global: configurable OAuthRemoteApp factory #45

Closed nharraud closed 8 years ago

nharraud commented 8 years ago

Problem: Some OAuth services like B2Access (which uses Unity) or reddit require the use of Basic HTTP authentication when retrieving the access token. Flask-OAuthlib provides an example as to how to handle this specific use-case. It requires a subclass of OAuthRemoteApp.

The problem is that there is currently no way to provide a custom OAuthRemoteApp to invenio-oauthclient. The extension creates clients by calling flask-oauth or flask-oauthlib remote_app method.

Suggested solution: Create a config variable which would default to the current behavior, but also enables the replacement of self.oauth.remote_app with a custom factory.

Who needs it: B2Share in order to use B2Access OAuth service.