From 568ad7599f2f66ebb82cf660f741cf600fbd9845 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Sun, 4 Dec 2016 19:00:36 +0100 Subject: [PATCH] Fix an invalid error description in OpenIddictProvider.Authentication.cs --- .../Infrastructure/OpenIddictProvider.Authentication.cs | 4 ++-- .../Infrastructure/OpenIddictProviderTests.Authentication.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/OpenIddict.Core/Infrastructure/OpenIddictProvider.Authentication.cs b/src/OpenIddict.Core/Infrastructure/OpenIddictProvider.Authentication.cs index 6174203d..5bd2ac44 100644 --- a/src/OpenIddict.Core/Infrastructure/OpenIddictProvider.Authentication.cs +++ b/src/OpenIddict.Core/Infrastructure/OpenIddictProvider.Authentication.cs @@ -206,13 +206,13 @@ namespace OpenIddict.Infrastructure { // Disallow the use of the unsecure code_challenge_method=plain method. // See https://tools.ietf.org/html/rfc7636#section-7.2 for more information. - if (context.Request.CodeChallengeMethod == OpenIdConnectConstants.CodeChallengeMethods.Plain) { + if (string.Equals(context.Request.CodeChallengeMethod, OpenIdConnectConstants.CodeChallengeMethods.Plain)) { services.Logger.LogError("The authorization request was rejected because the " + "'code_challenge_method' parameter was set to 'plain'."); context.Reject( error: OpenIdConnectConstants.Errors.InvalidRequest, - description: "The specified response_type parameter is not allowed when using PKCE."); + description: "The specified code_challenge_method parameter is not allowed."); return; } diff --git a/test/OpenIddict.Core.Tests/Infrastructure/OpenIddictProviderTests.Authentication.cs b/test/OpenIddict.Core.Tests/Infrastructure/OpenIddictProviderTests.Authentication.cs index 0ddde455..d2dfdec9 100644 --- a/test/OpenIddict.Core.Tests/Infrastructure/OpenIddictProviderTests.Authentication.cs +++ b/test/OpenIddict.Core.Tests/Infrastructure/OpenIddictProviderTests.Authentication.cs @@ -246,7 +246,7 @@ namespace OpenIddict.Core.Tests.Infrastructure { // Assert Assert.Equal(OpenIdConnectConstants.Errors.InvalidRequest, response.Error); - Assert.Equal("The specified response_type parameter is not allowed when using PKCE.", response.ErrorDescription); + Assert.Equal("The specified code_challenge_method parameter is not allowed.", response.ErrorDescription); } [Theory]