mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-23 15:57:23 -04:00
some debugging
This commit is contained in:
@@ -52,13 +52,14 @@ def _get_access_token(code, state):
|
|||||||
# JWT expiration time (10 minute maximum)
|
# JWT expiration time (10 minute maximum)
|
||||||
"exp": int(time.time()) + (10 * 60),
|
"exp": int(time.time()) + (10 * 60),
|
||||||
}
|
}
|
||||||
|
current_app.logger.warning(f"Here is the raw payload {payload}")
|
||||||
token = jwt.encode(payload, keystring, algorithm="RS256")
|
token = jwt.encode(payload, keystring, algorithm="RS256")
|
||||||
base_url = f"{access_token_url}?"
|
base_url = f"{access_token_url}?"
|
||||||
cli_assert = f"client_assertion={token}"
|
cli_assert = f"client_assertion={token}"
|
||||||
cli_assert_type = "client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer"
|
cli_assert_type = "client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer"
|
||||||
code_param = f"code={code}"
|
code_param = f"code={code}"
|
||||||
url = f"{base_url}{cli_assert}&{cli_assert_type}&{code_param}&grant_type=authorization_code"
|
url = f"{base_url}{cli_assert}&{cli_assert_type}&{code_param}&grant_type=authorization_code"
|
||||||
|
current_app.logger.info(f"This is the url we use to get the access token: {url}")
|
||||||
headers = {"Authorization": "Bearer %s" % token}
|
headers = {"Authorization": "Bearer %s" % token}
|
||||||
response = requests.post(url, headers=headers)
|
response = requests.post(url, headers=headers)
|
||||||
current_app.logger.info(f"GOT A RESPONSE {response.json()}")
|
current_app.logger.info(f"GOT A RESPONSE {response.json()}")
|
||||||
|
|||||||
Reference in New Issue
Block a user