0

I'm trying to get my access token for the stackexchange api . I already registered my app, but each time i'm trying the fetch_token() method, I got this error :

raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.

I tried to use this , this documentation at the "Backend Application Flow" , but I always have the same error.

My current code, with the error on the last line at fetch_token

def oauth_authentification(client_id, client_secret):

    redirect_uri = 'https://stackexchange.com/oauth/login_success'
    scope = 'no_expiry'
    auth = HTTPBasicAuth(client_id, client_secret)
    client = BackendApplicationClient(client_id=client_id)
    oauth = OAuth2Session(client=client)
    token = oauth.fetch_token(token_url='https://provider.com/oauth2/token', auth=auth)

All I want is to get that token so that I can use it to post multiple requests on https://api.stackexchange.com/2.3/

Thank you !

Helielzel
  • 1
  • 1

0 Answers0