Unsupported code_challenge_method parameter should return invalid_grant
Issue gh-770
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user