when using the Meltano SDK, is it possible to subs...
# plugins-general
d
when using the Meltano SDK, is it possible to substitute in the requests-oauthlib library for making HTTP requests to an API?
e
Yeah, anything you could pass as
auth=
in the requests library API can be used as an authenticator.
d
thanks @edgar_ramirez_mondragon! do you happen to know by chance which class(es) from
requests-oauthlib
can be used as authenticators for OAuth2? the
requests
library documentation mentions OAuth2 but simply links back to
requests-oauthlib
which uses its own client for making requests, rather than the native
requests
one
e
I haven't used
requests-oauthlib
but it seems
OAuth2Session
is a subclass of
requests.Session
so you could use that in your stream class
Copy code
class MyStream(RESTStream):
  @property
  def requests_session(self):
    session = OAuth2Session(...)
    return session