Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Validate client secret for confidential clients #15

Merged
merged 4 commits into from
Aug 4, 2024

Conversation

shawnz
Copy link
Contributor

@shawnz shawnz commented Aug 4, 2024

As discussed in this thread aliev/aioauth#91, the example app currently doesn't validate client secrets. This adds validation for client secrets as well as some tests to ensure the functionality works. The database schema was also changed to allow null client secrets for public non-confidential clients.

Before adding validation:

FAILED tests/test_oauth2.py::test_authorization_code_no_secret - AssertionError: no client secret for a confidential client should be rejected
FAILED tests/test_oauth2.py::test_authorization_code_wrong_secret - AssertionError: wrong client secret for a confidential client should be rejected

Results (28.04s):
       6 passed
       2 failed
         - tests/test_oauth2.py:88 test_authorization_code_no_secret
         - tests/test_oauth2.py:109 test_authorization_code_wrong_secret

After adding validation:

Results (26.11s):
       8 passed

@shawnz shawnz requested a review from aliev as a code owner August 4, 2024 02:37
@aliev
Copy link
Owner

aliev commented Aug 4, 2024

Hey, @shawnz. It looks good. Should I merge it?

@shawnz
Copy link
Contributor Author

shawnz commented Aug 4, 2024

Sure! Thanks for your time with this

@aliev aliev merged commit 57038e0 into aliev:master Aug 4, 2024
1 check passed
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