fixed inadvertent consistency bug in granting offline_access to clients

pull/324/merge
Justin Richer 12 years ago
parent 7307b4b19d
commit d7689152b8

@ -91,7 +91,11 @@ public class ClientDynamicRegistrationEndpoint {
// set default grant types if needed // set default grant types if needed
if (newClient.getGrantTypes() == null || newClient.getGrantTypes().isEmpty()) { if (newClient.getGrantTypes() == null || newClient.getGrantTypes().isEmpty()) {
newClient.setGrantTypes(Sets.newHashSet("authorization_code")); // allow authorization code grant type by default if (newClient.getScope().contains("offline_access")) { // client asked for offline access
newClient.setGrantTypes(Sets.newHashSet("authorization_code", "refresh_token")); // allow authorization code and refresh token grant types by default
} else {
newClient.setGrantTypes(Sets.newHashSet("authorization_code")); // allow authorization code grant type by default
}
} }
// set default response types if needed // set default response types if needed

Loading…
Cancel
Save