Support for Open Authentication (OAuth)

Arjuna supports the following OAuth grant types with its custom HTTP service objects:

OAuth Client Grant Service

Http.oauth_client_grant_service

It wraps the BackendApplicationClient object from requests_oauthlib package.

Once created, the session supports all methods in HttpService object discussed above.

Explore OAuthClientGrantService for constructor.

OAuth Implicit Grant Service

Http.oauth_implicit_grant_service

It wraps the MobileApplicationClient object from requests_oauthlib package.

Once created, the session supports all methods in HttpService object discussed above.

Explore OAuthImplicitGrantService for constructor.

Creating a New Service from an OAuth Service

Many a times, you will want to reuse the OAuthToken to connect to multiple services for testing.

Rather than creating a token each time, you can create it once by creating OAuthClientGrantService or OAuthImplicitGrantService.

Now you can use this OAuth session to create a new HttpService object for any base URL using create_new_service call.

oauth_service.create_new_service(url="https://someapp.com/api")