Convert times to int
Make iat_time, exp_time, auth_time an integer, not a float. The spec does not explicitly forbit float times, but some clients don't accept this (mod_auth_openidc), and `timetuple()` has second precision anyway so we don't loose any information.
This commit is contained in:
parent
1faeb6d5ab
commit
00f30dabbf
1 changed files with 3 additions and 3 deletions
|
@ -25,11 +25,11 @@ def create_id_token(user, aud, nonce=None):
|
|||
|
||||
now = timezone.now()
|
||||
# Convert datetimes into timestamps.
|
||||
iat_time = time.mktime(now.timetuple())
|
||||
exp_time = time.mktime((now + timedelta(seconds=expires_in)).timetuple())
|
||||
iat_time = int(time.mktime(now.timetuple()))
|
||||
exp_time = int(time.mktime((now + timedelta(seconds=expires_in)).timetuple()))
|
||||
|
||||
user_auth_time = user.last_login or user.date_joined
|
||||
auth_time = time.mktime(user_auth_time.timetuple())
|
||||
auth_time = int(time.mktime(user_auth_time.timetuple()))
|
||||
|
||||
dic = {
|
||||
'iss': get_issuer(),
|
||||
|
|
Loading…
Reference in a new issue