Skip to content
This repository was archived by the owner on Jun 1, 2023. It is now read-only.

Commit c895d6a

Browse files
committed
Need to be able to add a jti claim to a JWT when using the make_openid_request function.
Bumped version number since this can't be done with previous versions.
1 parent 4b07563 commit c895d6a

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/oidcmsg/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
__author__ = 'Roland Hedberg'
2-
__version__ = '1.1.1'
2+
__version__ = '1.1.2'
33

44
VERIFIED_CLAIM_PREFIX = '__verified'
55

src/oidcmsg/oidc/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ def factory(msgtype, **kwargs):
11571157
return oauth2.factory(msgtype, **kwargs)
11581158

11591159

1160-
def make_openid_request(arq, keys, issuer, request_object_signing_alg, recv):
1160+
def make_openid_request(arq, keys, issuer, request_object_signing_alg, recv, with_jti=False):
11611161
"""
11621162
Construct the JWT to be passed by value (the request parameter) or by
11631163
reference (request_uri).
@@ -1168,10 +1168,13 @@ def make_openid_request(arq, keys, issuer, request_object_signing_alg, recv):
11681168
:param issuer: Who is signing this JSON Web Token
11691169
:param request_object_signing_alg: Which signing algorithm to use
11701170
:param recv: The intended receiver of the request
1171+
:param with_jti: Whether a JTI should be included in the JWT.
11711172
:return: JWT encoded OpenID request
11721173
"""
11731174

11741175
_jwt = JWT(key_jar=keys, iss=issuer, sign_alg=request_object_signing_alg)
1176+
if with_jti:
1177+
_jwt.with_jti = True
11751178
return _jwt.pack(arq.to_dict(), owner=issuer, recv=recv)
11761179

11771180

0 commit comments

Comments
 (0)