diff --git a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientDynamicRegistrationEndpoint.java b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientDynamicRegistrationEndpoint.java index 4e1bbd348..2da446f36 100644 --- a/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientDynamicRegistrationEndpoint.java +++ b/openid-connect-server/src/main/java/org/mitre/openid/connect/web/ClientDynamicRegistrationEndpoint.java @@ -91,7 +91,11 @@ public class ClientDynamicRegistrationEndpoint { // set default grant types if needed 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