makes the grant types checker softer, closes #640
parent
2a2a86a14d
commit
8768188133
|
@ -397,14 +397,10 @@ public class ClientDynamicRegistrationEndpoint {
|
||||||
// filter out unknown grant types
|
// filter out unknown grant types
|
||||||
// TODO: make this a pluggable service
|
// TODO: make this a pluggable service
|
||||||
Set<String> requestedGrantTypes = new HashSet<String>(newClient.getGrantTypes());
|
Set<String> requestedGrantTypes = new HashSet<String>(newClient.getGrantTypes());
|
||||||
requestedGrantTypes.removeAll(
|
requestedGrantTypes.retainAll(
|
||||||
ImmutableSet.of("authorization_code", "implicit",
|
ImmutableSet.of("authorization_code", "implicit",
|
||||||
"password", "client_credentials", "refresh_token",
|
"password", "client_credentials", "refresh_token",
|
||||||
"urn:ietf:params:oauth:grant_type:redelegate"));
|
"urn:ietf:params:oauth:grant_type:redelegate"));
|
||||||
if (!requestedGrantTypes.isEmpty()) {
|
|
||||||
// return an error, there were unknown grant types requested
|
|
||||||
throw new ValidationException("invalid_client_metadata", "Unknown grant types requested: " + newClient.getGrantTypes(), HttpStatus.BAD_REQUEST);
|
|
||||||
}
|
|
||||||
|
|
||||||
// don't allow "password" grant type for dynamic registration
|
// don't allow "password" grant type for dynamic registration
|
||||||
if (newClient.getGrantTypes().contains("password")) {
|
if (newClient.getGrantTypes().contains("password")) {
|
||||||
|
|
Loading…
Reference in New Issue