Set device code validity in seconds for dynreg clients
parent
92c47c5449
commit
2eb5d1b3e2
|
@ -22,7 +22,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>openid-connect-parent</artifactId>
|
<artifactId>openid-connect-parent</artifactId>
|
||||||
<groupId>org.mitre</groupId>
|
<groupId>org.mitre</groupId>
|
||||||
<version>1.3.3.cnaf.rc0</version>
|
<version>1.3.4.cnaf-SNAPSHOT</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>openid-connect-client</artifactId>
|
<artifactId>openid-connect-client</artifactId>
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<artifactId>openid-connect-parent</artifactId>
|
<artifactId>openid-connect-parent</artifactId>
|
||||||
<groupId>org.mitre</groupId>
|
<groupId>org.mitre</groupId>
|
||||||
<version>1.3.3.cnaf.rc0</version>
|
<version>1.3.4.cnaf-SNAPSHOT</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<artifactId>openid-connect-common</artifactId>
|
<artifactId>openid-connect-common</artifactId>
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.mitre</groupId>
|
<groupId>org.mitre</groupId>
|
||||||
<artifactId>openid-connect-parent</artifactId>
|
<artifactId>openid-connect-parent</artifactId>
|
||||||
<version>1.3.3.cnaf.rc0</version>
|
<version>1.3.4.cnaf-SNAPSHOT</version>
|
||||||
<relativePath>..</relativePath>
|
<relativePath>..</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -233,6 +233,10 @@ public class DynamicClientRegistrationEndpoint {
|
||||||
newClient.setRefreshTokenValiditySeconds(null); // refresh tokens good until revoked
|
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)
|
// this client has been dynamically registered (obviously)
|
||||||
newClient.setDynamicallyRegistered(true);
|
newClient.setDynamicallyRegistered(true);
|
||||||
|
|
||||||
|
@ -354,6 +358,7 @@ public class DynamicClientRegistrationEndpoint {
|
||||||
newClient.setAccessTokenValiditySeconds(oldClient.getAccessTokenValiditySeconds());
|
newClient.setAccessTokenValiditySeconds(oldClient.getAccessTokenValiditySeconds());
|
||||||
newClient.setIdTokenValiditySeconds(oldClient.getIdTokenValiditySeconds());
|
newClient.setIdTokenValiditySeconds(oldClient.getIdTokenValiditySeconds());
|
||||||
newClient.setRefreshTokenValiditySeconds(oldClient.getRefreshTokenValiditySeconds());
|
newClient.setRefreshTokenValiditySeconds(oldClient.getRefreshTokenValiditySeconds());
|
||||||
|
newClient.setDeviceCodeValiditySeconds(oldClient.getDeviceCodeValiditySeconds());
|
||||||
newClient.setDynamicallyRegistered(true); // it's still dynamically registered
|
newClient.setDynamicallyRegistered(true); // it's still dynamically registered
|
||||||
newClient.setAllowIntrospection(false); // dynamically registered clients can't do introspection -- use the resource registration instead
|
newClient.setAllowIntrospection(false); // dynamically registered clients can't do introspection -- use the resource registration instead
|
||||||
newClient.setAuthorities(oldClient.getAuthorities());
|
newClient.setAuthorities(oldClient.getAuthorities());
|
||||||
|
@ -390,6 +395,7 @@ public class DynamicClientRegistrationEndpoint {
|
||||||
newClient.getGrantTypes().addAll(oldClientGrantedGrantTypes);
|
newClient.getGrantTypes().addAll(oldClientGrantedGrantTypes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// save the client
|
// save the client
|
||||||
ClientDetailsEntity savedClient = clientService.updateClient(oldClient, newClient);
|
ClientDetailsEntity savedClient = clientService.updateClient(oldClient, newClient);
|
||||||
|
|
||||||
|
|
2
pom.xml
2
pom.xml
|
@ -20,7 +20,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.mitre</groupId>
|
<groupId>org.mitre</groupId>
|
||||||
<artifactId>openid-connect-parent</artifactId>
|
<artifactId>openid-connect-parent</artifactId>
|
||||||
<version>1.3.3.cnaf.rc0</version>
|
<version>1.3.4.cnaf-SNAPSHOT</version>
|
||||||
<name>MITREid Connect</name>
|
<name>MITREid Connect</name>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<parent>
|
<parent>
|
||||||
|
|
Loading…
Reference in New Issue