Skip to content

Commit 2ddebf0

Browse files
committed
Add code_challenge_methods_supported property to OIDC auto discovery
Fix #1249
1 parent 862cb7a commit 2ddebf0

File tree

4 files changed

+7
-0
lines changed

4 files changed

+7
-0
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Egor Poderiagin
5252
Emanuele Palazzetti
5353
Federico Dolce
5454
Frederico Vieira
55+
Gaël Utard
5556
Hasan Ramezani
5657
Hiroki Kiyohara
5758
Hossein Shakiba

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2626
* #1311 Add option to disable client_secret hashing to allow verifying JWTs' signatures.
2727
* #1337 Gracefully handle expired or deleted refresh tokens, in `validate_user`.
2828
* #1350 Support Python 3.12 and Django 5.0
29+
* #1249 Add code_challenge_methods_supported property to auto discovery informations
2930

3031
### Fixed
3132
* #1322 Instructions in documentation on how to create a code challenge and code verifier

oauth2_provider/views/oidc.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
from ..forms import ConfirmLogoutForm
2727
from ..http import OAuth2ResponseRedirect
2828
from ..models import (
29+
AbstractGrant,
2930
get_access_token_model,
3031
get_application_model,
3132
get_id_token_model,
@@ -96,6 +97,7 @@ def get(self, request, *args, **kwargs):
9697
"token_endpoint_auth_methods_supported": (
9798
oauth2_settings.OIDC_TOKEN_ENDPOINT_AUTH_METHODS_SUPPORTED
9899
),
100+
"code_challenge_methods_supported": [key for key, _ in AbstractGrant.CODE_CHALLENGE_METHODS],
99101
"claims_supported": oidc_claims,
100102
}
101103
if oauth2_settings.OIDC_RP_INITIATED_LOGOUT_ENABLED:

tests/test_oidc_views.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ def test_get_connect_discovery_info(self):
4848
"subject_types_supported": ["public"],
4949
"id_token_signing_alg_values_supported": ["RS256", "HS256"],
5050
"token_endpoint_auth_methods_supported": ["client_secret_post", "client_secret_basic"],
51+
"code_challenge_methods_supported": ["plain", "S256"],
5152
"claims_supported": ["sub"],
5253
}
5354
response = self.client.get(reverse("oauth2_provider:oidc-connect-discovery-info"))
@@ -74,6 +75,7 @@ def expect_json_response_with_rp(self, base):
7475
"subject_types_supported": ["public"],
7576
"id_token_signing_alg_values_supported": ["RS256", "HS256"],
7677
"token_endpoint_auth_methods_supported": ["client_secret_post", "client_secret_basic"],
78+
"code_challenge_methods_supported": ["plain", "S256"],
7779
"claims_supported": ["sub"],
7880
"end_session_endpoint": f"{base}/logout/",
7981
}
@@ -107,6 +109,7 @@ def test_get_connect_discovery_info_without_issuer_url(self):
107109
"subject_types_supported": ["public"],
108110
"id_token_signing_alg_values_supported": ["RS256", "HS256"],
109111
"token_endpoint_auth_methods_supported": ["client_secret_post", "client_secret_basic"],
112+
"code_challenge_methods_supported": ["plain", "S256"],
110113
"claims_supported": ["sub"],
111114
}
112115
response = self.client.get(reverse("oauth2_provider:oidc-connect-discovery-info"))

0 commit comments

Comments
 (0)