code: def get_access_token(username: str, password: str, app_id: str, app_secret: str) -> str:
      
      payload = {
          'client_id': app_id,
          'client_secret': app_secret,
          'grant_type': "password",
          'username': username,
          'password': password
      }
  
      response = requests.post("{base_url}/oauth/token".format(base_url=INAT_BASE_URL), payload)
      try:
          return response.json()["access_token"]
      except KeyError:
          raise AuthenticationError("Authentication error, please check credentials.")
docs: Get an access token using the user's iNaturalist username and password.
  
      (you still need an iNaturalist app to do this)
  
      :param username:
      :param password:
      :param app_id:
      :param app_secret:
      :return: the access token, example use: headers = {"Authorization": "Bearer %s" % access_token}