File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 77from urllib .parse import urlsplit
88from urllib .parse import urlunsplit
99
10+ from cryptojwt .jws .jws import factory
11+
1012from idpyoidc .constant import DEFAULT_POST_CONTENT_TYPE
1113from idpyoidc .constant import JOSE_ENCODED
1214from idpyoidc .constant import JSON_ENCODED
@@ -264,7 +266,11 @@ def get_deserialization_method(reqresp):
264266 reqresp .json ()
265267 return "json"
266268 except Exception :
267- return "urlencoded" # reasonable default ??
269+ try :
270+ _jwt = factory (reqresp .txt )
271+ return "jwt"
272+ except Exception :
273+ return "urlencoded" # reasonable default ??
268274
269275 if match_to_ ("application/json" , _ctype ) or match_to_ ("application/jrd+json" , _ctype ):
270276 deser_method = "json"
@@ -276,6 +282,8 @@ def get_deserialization_method(reqresp):
276282 deser_method = "urlencoded"
277283 elif match_to_ ("text/plain" , _ctype ) or match_to_ ("test/html" , _ctype ):
278284 deser_method = ""
285+ elif _ctype .startswith ("application/" ) and _ctype .endswith ("+jwt" ):
286+ deser_method = "jwt"
279287 else :
280288 deser_method = "" # reasonable default ??
281289
You can’t perform that action at this time.
0 commit comments