fixed inadvertent consistency bug in granting offline_access to clients
parent
7307b4b19d
commit
d7689152b8
|
@ -91,8 +91,12 @@ 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()) {
|
||||||
|
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
|
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
|
||||||
// TODO: these aren't checked by SECOAUTH
|
// TODO: these aren't checked by SECOAUTH
|
||||||
|
|
Loading…
Reference in New Issue