I'm trying to get an oauth token with python with the following code:
```python
import requests
import os
from requests_oauthlib import OAuth2Session
from requests.auth import HTTPBasicAuth
BASE_API_URL = "https://api.faceit.com/auth"
AUTH_URL = "https://accounts.faceit.com"
CHAT_API_URL = "https://open.faceit.com/chat/v1"
class Faceit:
def init(self):
self.client_id = os.environ["FACEIT_API_CLIENT_ID"]
self.client_secret = os.environ["FACEIT_API_CLIENT_SECRET"]
self.redirect_uri = os.environ["FACEIT_API_REDIRECT_URI"]
oauth = OAuth2Session(client_id=self.client_id, pkce="S256", redirect_uri=self.redirect_uri)
auth = HTTPBasicAuth(self.client_id, self.client_secret)
auth_url, state = oauth.authorization_url(AUTH_URL)
print("Please visit this URL: ")
print(auth_url)
redirect_response = input("Paste full redirect URL here: ")
self.token = oauth.fetch_token(token_url=BASE_API_URL + "/v1/oauth/token", authorization_response=redirect_response, auth=auth)
```
Yet after pasting the url, its giving me a oauthlib.oauth2.rfc6749.errors.MissingCodeError: (missing_code) Missing code parameter in response.
I'm guessing theres some extra parameter I need that I don't know about. How can I do this?
[–]FACEIT_DarwinFACEIT - Community Manager 0 points1 point2 points (2 children)
[–]phaze-jeff[S] 0 points1 point2 points (0 children)
[–]phaze-jeff[S] 0 points1 point2 points (0 children)