def METHOD_NAME(self):
    url = self.authBasePath
    payload = {
        "client_id": "registry-frontend",
        "username": self.username,
        "password": self.password,
        "grant_type": "password",
    }
    payload_urlencoded = urlencode(payload)
    headers = {"content-type": "application/x-www-form-urlencoded"}
    response = requests.request(
        "POST", url, headers=headers, data=payload_urlencoded
    )
    y = json.loads(response.text)
    return y["access_token"]