Repository: jazzband/django-oauth-toolkit

Issue:
Allow Authorization Code flow without a client_secret - Initial commit with Patch & testcases
Hello @n2ygk 
Here's the PR

<!-- See  https://django-oauth-toolkit.readthedocs.io/en/latest/contributing.html#pull-requests -->
<!-- If there's already an issue that this PR fixes, add that issue number below after 'Fixes #' -->
Fixes #1092

## Description of the Change
Patch to address -> Allow Authorization Code flow without a client_secret #1092
Edited oauth2_provider/oauth2_validators.py and added testcases to tests/test_oauth2_validators.py
Ran tox. Seems alright


## Checklist

<!-- Replace '[ ]' with '[x]' to indicate that the checklist item is completed. -->
<!-- You can check the boxes now or later by just clicking on them. -->

- [x] PR only contains one change (considered splitting up PR)
- [x] unit-test added
- [ ] documentation updated
- [x] `CHANGELOG.md` updated (only for user relevant changes)
- [x] author name in `AUTHORS`



Discussion:
## [Codecov](https://app.codecov.io/gh/jazzband/django-oauth-toolkit/pull/1276?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jazzband) Report
> Merging [#1276](https://app.codecov.io/gh/jazzband/django-oauth-toolkit/pull/1276?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jazzband) (3ee6e66) into [master](https://app.codecov.io/gh/jazzband/django-oauth-toolkit/commit/016c6c3bf62c282991c2ce3164e8233b81e3dd4d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jazzband) (016c6c3) will **decrease** coverage by `0.06%`.
> The diff coverage is `100.00%`.

```diff
@@            Coverage Diff             @@
##           master    #1276      +/-   ##
==========================================
- Coverage   97.29%   97.24%   -0.06%     
==========================================
  Files          31       31              
  Lines        1996     1996              
==========================================
- Hits         1942     1941       -1     
- Misses         54       55       +1     
```


| [Impacted Files](https://app.codecov.io/gh/jazzband/django-oauth-toolkit/pull/1276?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jazzband) | Coverage Δ | |
|---|---|---|
| [oauth2\_provider/oauth2\_validators.py](https://app.codecov.io/gh/jazzband/django-oauth-toolkit/pull/1276?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jazzband#diff-b2F1dGgyX3Byb3ZpZGVyL29hdXRoMl92YWxpZGF0b3JzLnB5) | `93.98% <100.00%> (ø)` | |

... and [1 file with indirect coverage changes](https://app.codecov.io/gh/jazzband/django-oauth-toolkit/pull/1276/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jazzband)

:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=jazzband)

Thank you @n2ygk for the merge and support! :smile: 

Resolving patch:
diff --git a/oauth2_provider/oauth2_validators.py b/oauth2_provider/oauth2_validators.py
--- a/oauth2_provider/oauth2_validators.py
+++ b/oauth2_provider/oauth2_validators.py
@@ -183,7 +183,7 @@ def _authenticate_request_body(self, request):
         # TODO: check if oauthlib has already unquoted client_id and client_secret
         try:
             client_id = request.client_id
-            client_secret = getattr(request, "client_secret", "")
+            client_secret = getattr(request, "client_secret", "") or ""
         except AttributeError:
             return False
 


Test patch: