Browse Source

Update AttachCodeChallengeMethods to only return code_challenge_methods_supported when the code flow was enabled

pull/798/head
Kévin Chalet 7 years ago
parent
commit
7a1ad7aa2f
  1. 4
      src/OpenIddict.Server/OpenIddictServerHandlers.Discovery.cs

4
src/OpenIddict.Server/OpenIddictServerHandlers.Discovery.cs

@ -681,8 +681,8 @@ namespace OpenIddict.Server
throw new ArgumentNullException(nameof(context));
}
// Only populate code_challenge_methods_supported if both the authorization and token endpoints are enabled.
if (context.AuthorizationEndpoint != null && context.TokenEndpoint != null)
// Only populate code_challenge_methods_supported if the code flow was enabled.
if (context.GrantTypes.Contains(GrantTypes.AuthorizationCode))
{
// Note: supporting S256 is mandatory for authorization servers that implement PKCE.
// See https://tools.ietf.org/html/rfc7636#section-4.2 for more information.

Loading…
Cancel
Save