|
|
@ -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
|
|
|
|