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

Commit 5b654d0

Browse files
committed
"AttributeError: 'dict' object has no attribute 'startswith'" in oidcendpoint/endpoint.py(158)client_authentication()
because using gunicorn webserver request is {} patched, need revision modified: src/oidcendpoint/client_authn.py
1 parent 7a3a0a4 commit 5b654d0

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

src/oidcendpoint/client_authn.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,12 @@ def verify_client(endpoint_context, request, authorization_info=None):
202202
possibly access token.
203203
"""
204204

205+
# fixes request = {} instead of str
206+
# "AttributeError: 'dict' object has no attribute 'startswith'" in oidcendpoint/endpoint.py(158)client_authentication()
207+
if isinstance(authorization_info, dict):
208+
strings_parade = ('{} {}'.format(k,v) for k,v in authorization_info.items())
209+
authorization_info = ' '.join(strings_parade)
210+
205211
if authorization_info is None:
206212
if 'client_id' in request and 'client_secret' in request:
207213
auth_info = ClientSecretPost(endpoint_context).verify(request)

src/oidcendpoint/endpoint.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
parse_request
2424
- client_authentication (*)
2525
- post_parse_request (*)
26-
26+
2727
process_request
2828
29-
do_response
29+
do_response
3030
- response_info
31-
- construct
31+
- construct
3232
- pre_construct (*)
3333
- _parse_args
3434
- post_construct (*)

0 commit comments

Comments
 (0)