Update oauth2.py to include provider Xero
The added class Xero(OAuth2) will support the recently released Xero OAuth 2.0 APIs.
The flow respects Xero OAuth 2.0 flow and provide user information by decoding the JWT token returned via OpenID connect.
Example for refresh token: result.user.credentials.refresh()
Example for accessing protected resources: authomatic.access( result.user.credentials, headers={ "xero-tenant-id": first_tenantId, }, url='https://api.xero.com/api.xro/2.0/Contacts')
Xero only provides user info in jwt token, so for this to work, the oauth2.py need to have python-jwt dependency included.
build error: ERROR: InvocationError for command /home/travis/build/authomatic/authomatic/.tox/py3/bin/pylint --errors-only --ignore=six.py authomatic (exited with code 2)
Thanks for this PR. To start with can you add the jwt dependency to the deps list in tox.ini - this should get the most basic of tests running properly against this change.
It looks like in the past e haven't had the test suite run against Xero as it's a paid for service, which would require a 'free trial' account to be generated every month, which is too much effort. Please let us know if this is still the case? If so we would review and accept the pull request without testing and just add a caveat to the documentation explaining this.