add auth_time in id_token

This commit is contained in:
Son NK 2019-08-10 17:04:43 +02:00
parent f6e71436ec
commit efddc68764
2 changed files with 5 additions and 4 deletions

View File

@ -28,6 +28,7 @@ def make_id_token(client_user: ClientUser):
"aud": client_user.client.oauth_client_id,
"exp": arrow.now().shift(hours=1).timestamp,
"iat": arrow.now().timestamp,
"auth_time": arrow.now().timestamp,
}
claims = {**claims, **client_user.get_user_info()}

View File

@ -159,13 +159,13 @@ def test_authorize_code_flow_no_openid_scope(flask_client):
assert len(queries["code"]) == 1
# Exchange the code to get access_token
valid_credentials = base64.b64encode(
basic_auth_headers = base64.b64encode(
f"{client.oauth_client_id}:{client.oauth_client_secret}".encode()
).decode("utf-8")
r = flask_client.post(
url_for("oauth.token"),
headers={"Authorization": "Basic " + valid_credentials},
headers={"Authorization": "Basic " + basic_auth_headers},
data={"grant_type": "authorization_code", "code": queries["code"][0]},
)
@ -245,13 +245,13 @@ def test_authorize_code_flow_with_openid_scope(flask_client):
assert len(queries["code"]) == 1
# Exchange the code to get access_token
valid_credentials = base64.b64encode(
basic_auth_headers = base64.b64encode(
f"{client.oauth_client_id}:{client.oauth_client_secret}".encode()
).decode("utf-8")
r = flask_client.post(
url_for("oauth.token"),
headers={"Authorization": "Basic " + valid_credentials},
headers={"Authorization": "Basic " + basic_auth_headers},
data={"grant_type": "authorization_code", "code": queries["code"][0]},
)