Set device code validity in seconds for dynreg clients
parent
92c47c5449
commit
2eb5d1b3e2
|
@ -22,7 +22,7 @@
|
|||
<parent>
|
||||
<artifactId>openid-connect-parent</artifactId>
|
||||
<groupId>org.mitre</groupId>
|
||||
<version>1.3.3.cnaf.rc0</version>
|
||||
<version>1.3.4.cnaf-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>openid-connect-client</artifactId>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<parent>
|
||||
<artifactId>openid-connect-parent</artifactId>
|
||||
<groupId>org.mitre</groupId>
|
||||
<version>1.3.3.cnaf.rc0</version>
|
||||
<version>1.3.4.cnaf-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<artifactId>openid-connect-common</artifactId>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<parent>
|
||||
<groupId>org.mitre</groupId>
|
||||
<artifactId>openid-connect-parent</artifactId>
|
||||
<version>1.3.3.cnaf.rc0</version>
|
||||
<version>1.3.4.cnaf-SNAPSHOT</version>
|
||||
<relativePath>..</relativePath>
|
||||
</parent>
|
||||
<build>
|
||||
|
|
|
@ -232,7 +232,11 @@ public class DynamicClientRegistrationEndpoint {
|
|||
newClient.setIdTokenValiditySeconds((int)TimeUnit.MINUTES.toSeconds(10)); // id tokens good for 10min
|
||||
newClient.setRefreshTokenValiditySeconds(null); // refresh tokens good until revoked
|
||||
}
|
||||
|
||||
|
||||
if (newClient.getGrantTypes().contains("urn:ietf:params:oauth:grant-type:device_code")) {
|
||||
newClient.setDeviceCodeValiditySeconds(600);
|
||||
}
|
||||
|
||||
// this client has been dynamically registered (obviously)
|
||||
newClient.setDynamicallyRegistered(true);
|
||||
|
||||
|
@ -354,6 +358,7 @@ public class DynamicClientRegistrationEndpoint {
|
|||
newClient.setAccessTokenValiditySeconds(oldClient.getAccessTokenValiditySeconds());
|
||||
newClient.setIdTokenValiditySeconds(oldClient.getIdTokenValiditySeconds());
|
||||
newClient.setRefreshTokenValiditySeconds(oldClient.getRefreshTokenValiditySeconds());
|
||||
newClient.setDeviceCodeValiditySeconds(oldClient.getDeviceCodeValiditySeconds());
|
||||
newClient.setDynamicallyRegistered(true); // it's still dynamically registered
|
||||
newClient.setAllowIntrospection(false); // dynamically registered clients can't do introspection -- use the resource registration instead
|
||||
newClient.setAuthorities(oldClient.getAuthorities());
|
||||
|
@ -390,6 +395,7 @@ public class DynamicClientRegistrationEndpoint {
|
|||
newClient.getGrantTypes().addAll(oldClientGrantedGrantTypes);
|
||||
}
|
||||
|
||||
|
||||
// save the client
|
||||
ClientDetailsEntity savedClient = clientService.updateClient(oldClient, newClient);
|
||||
|
||||
|
|
Loading…
Reference in New Issue