Skip to content

Conversation

amanning9
Copy link
Contributor

Description of the Change

#1311 allowed the use of unhashed client secrets, but if a secret is unhashed it does not work if the client includes it's client_id and client_secret in the request body, instead of using basic auth- only hashed secrets work in that case.

This PR allows hashed or unhashed secrets in _authenticate_request_body too, and adds a test for this case.

I think this is small enough that it can really just be considered part of 1311 in terms of documentation and changelog- but if I'm wrong please let me know and I can come back.

Checklist

  • PR only contains one change (considered splitting up PR)
  • unit-test added
  • documentation updated
  • CHANGELOG.md updated (only for user relevant changes)
  • author name in AUTHORS

Allow the client to send credentials in the request body when the
application has an unhashed secret.

Signed-off-by: Alex Manning <[email protected]>
Signed-off-by: Alex Manning <[email protected]>
Copy link
Contributor

@n2ygk n2ygk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this and especially for improving code coverage.

@codecov
Copy link

codecov bot commented Oct 7, 2023

Codecov Report

Merging #1334 (81176c2) into master (41591ad) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #1334   +/-   ##
=======================================
  Coverage   97.44%   97.44%           
=======================================
  Files          32       32           
  Lines        2073     2073           
=======================================
  Hits         2020     2020           
  Misses         53       53           
Files Coverage Δ
oauth2_provider/oauth2_validators.py 94.07% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@n2ygk n2ygk merged commit 1c01da7 into django-oauth:master Oct 7, 2023
@amanning9 amanning9 deleted the fix-unhashed-body-secret branch October 9, 2023 14:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants