throw appropriate errors from request factory

pull/516/head
Justin Richer 11 years ago
parent e67a41c556
commit 35bd9c8eda

@ -171,7 +171,7 @@ public class ConnectOAuth2RequestFactory extends DefaultOAuth2RequestFactory {
if (client.getRequestObjectSigningAlg() != null) { if (client.getRequestObjectSigningAlg() != null) {
if (!client.getRequestObjectSigningAlg().equals(alg)) { if (!client.getRequestObjectSigningAlg().equals(alg)) {
throw new AuthenticationServiceException("Client's registered request object signing algorithm (" + client.getRequestObjectSigningAlg() + ") does not match request object's actual algorithm (" + alg.getName() + ")"); throw new InvalidClientException("Client's registered request object signing algorithm (" + client.getRequestObjectSigningAlg() + ") does not match request object's actual algorithm (" + alg.getName() + ")");
} }
} }
@ -193,7 +193,7 @@ public class ConnectOAuth2RequestFactory extends DefaultOAuth2RequestFactory {
} }
if (!validator.validateSignature(signedJwt)) { if (!validator.validateSignature(signedJwt)) {
throw new AuthenticationServiceException("Signature did not validate for presented JWT request object."); throw new InvalidClientException("Signature did not validate for presented JWT request object.");
} }
} else if (alg.equals(JWSAlgorithm.HS256) } else if (alg.equals(JWSAlgorithm.HS256)
|| alg.equals(JWSAlgorithm.HS384) || alg.equals(JWSAlgorithm.HS384)
@ -208,7 +208,7 @@ public class ConnectOAuth2RequestFactory extends DefaultOAuth2RequestFactory {
} }
if (!validator.validateSignature(signedJwt)) { if (!validator.validateSignature(signedJwt)) {
throw new AuthenticationServiceException("Signature did not validate for presented JWT request object."); throw new InvalidClientException("Signature did not validate for presented JWT request object.");
} }

Loading…
Cancel
Save