Unsupported code_challenge_method parameter should return invalid_grant

Issue gh-770
This commit is contained in:
Joe Grandja
2022-06-15 09:24:42 -04:00
parent 7dfdcf3a27
commit 4199ab0172
2 changed files with 3 additions and 2 deletions

View File

@@ -122,9 +122,10 @@ final class CodeVerifierAuthenticator {
} catch (NoSuchAlgorithmException ex) {
// It is unlikely that SHA-256 is not available on the server. If it is not available,
// there will likely be bigger issues as well. We default to SERVER_ERROR.
throw new OAuth2AuthenticationException(OAuth2ErrorCodes.SERVER_ERROR);
}
}
throw new OAuth2AuthenticationException(OAuth2ErrorCodes.SERVER_ERROR);
return false;
}
private static void throwInvalidGrant(String parameterName) {

View File

@@ -275,7 +275,7 @@ public class PublicClientAuthenticationProviderTests {
.isInstanceOf(OAuth2AuthenticationException.class)
.extracting(ex -> ((OAuth2AuthenticationException) ex).getError())
.extracting("errorCode")
.isEqualTo(OAuth2ErrorCodes.SERVER_ERROR);
.isEqualTo(OAuth2ErrorCodes.INVALID_GRANT);
}
private static Map<String, Object> createAuthorizationCodeTokenParameters() {