Xavier Ashe :donor: on Nostr: npub1aka6w…mzzz2 Can you use requests-oauthlib? from requests_oauthlib import ...
npub1aka6wf78hfaqpz060r246dq80lmtjx6uf7wapct4ljluyfx956hszmzzz2 (npub1aka…zzz2) Can you use requests-oauthlib?
from requests_oauthlib import OAuth2Session
client_id = "client_id"
client_secret = "client_secret"
redirect_uri = "redirect URI"
# Create a session object
oauth = OAuth2Session(client_id, redirect_uri = redirect_uri)
# Fetch a token
token = oauth.fetch_token("<url to fetch access token>", client_secret = client_secret)
# Get your authenticated response
resp = oauth.get("URL to the resource")
from requests_oauthlib import OAuth2Session
client_id = "client_id"
client_secret = "client_secret"
redirect_uri = "redirect URI"
# Create a session object
oauth = OAuth2Session(client_id, redirect_uri = redirect_uri)
# Fetch a token
token = oauth.fetch_token("<url to fetch access token>", client_secret = client_secret)
# Get your authenticated response
resp = oauth.get("URL to the resource")