Fix device code timeout setting for dynreg clients

pull/1611/head
Andrea Ceccanti 2019-07-05 06:53:07 +02:00
parent 4897baf8f3
commit 9683cd6158
2 changed files with 6 additions and 7 deletions

7
Jenkinsfile vendored
View File

@ -1,11 +1,14 @@
#!/usr/bin/env groovy
@Library('sd')_
def kubeLabel = getKubeLabel()
pipeline {
agent {
kubernetes {
label "oidc-java-sprint-server-${env.JOB_BASE_NAME}-${env.BUILD_NUMBER}"
label "${kubeLabel}"
cloud 'Kube mwdevel'
defaultContainer 'jnlp'
defaultContainer 'runner'
inheritFrom 'ci-template'
}
}

View File

@ -231,11 +231,9 @@ public class DynamicClientRegistrationEndpoint {
newClient.setAccessTokenValiditySeconds((int)TimeUnit.HOURS.toSeconds(1)); // access tokens good for 1hr
newClient.setIdTokenValiditySeconds((int)TimeUnit.MINUTES.toSeconds(10)); // id tokens good for 10min
newClient.setRefreshTokenValiditySeconds(null); // refresh tokens good until revoked
newClient.setDeviceCodeValiditySeconds((int)TimeUnit.MINUTES.toSeconds(10));
}
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);
@ -394,8 +392,6 @@ public class DynamicClientRegistrationEndpoint {
if (!oldClientGrantedGrantTypes.isEmpty()) {
newClient.getGrantTypes().addAll(oldClientGrantedGrantTypes);
}
// save the client
ClientDetailsEntity savedClient = clientService.updateClient(oldClient, newClient);