Skip to content

Commit 6ae8197

Browse files
glaucojunior22Glauco Juniorn2ygk
authored
Fix the invalid_client error when request token without the client_secret field (#1288)
* Fix the invalid_client error when request token without the client_secret field. * add a CHANGELOG entry since this is a user-visible change. --------- Co-authored-by: Glauco Junior <[email protected]> Co-authored-by: Alan Crosswell <[email protected]>
1 parent 0aa27a0 commit 6ae8197

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Federico Dolce
5555
Florian Demmer
5656
Frederico Vieira
5757
Gaël Utard
58+
Glauco Junior
5859
Hasan Ramezani
5960
Hiroki Kiyohara
6061
Hossein Shakiba

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
3737
* #1357 Move import of setting_changed signal from test to django core modules
3838
* #1268 fix prompt=none redirects to login screen
3939
* #1381 fix AttributeError in OAuth2ExtraTokenMiddleware when a custom AccessToken model is used
40+
* #1288 fixes #1276 which attempt to resolve #1092 for requests that don't have a client_secret per [RFC 6749 4.1.1](https://www.rfc-editor.org/rfc/rfc6749.html#section-4.1.1)
4041

4142
### Removed
4243
* #1350 Remove support for Python 3.7 and Django 2.2

oauth2_provider/oauth2_validators.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ def _authenticate_request_body(self, request):
183183
# TODO: check if oauthlib has already unquoted client_id and client_secret
184184
try:
185185
client_id = request.client_id
186-
client_secret = getattr(request, "client_secret", "")
186+
client_secret = getattr(request, "client_secret", "") or ""
187187
except AttributeError:
188188
return False
189189

0 commit comments

Comments
 (0)