From 8adad9dddf99e699d06d7f29a956966e5fa391df Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Fri, 31 Oct 2014 09:20:05 +0100 Subject: [PATCH] KEYCLOAK-806 Increase defaults for 'SSO Session Idle Timeout' --- .../java/org/keycloak/models/utils/RepresentationToModel.java | 2 +- .../org/keycloak/services/managers/ApplianceBootstrap.java | 2 +- .../java/org/keycloak/testsuite/oauth/RefreshTokenTest.java | 2 +- .../test/java/org/keycloak/testsuite/saml/SamlBindingTest.java | 3 +-- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/model/api/src/main/java/org/keycloak/models/utils/RepresentationToModel.java b/model/api/src/main/java/org/keycloak/models/utils/RepresentationToModel.java index 961039505d..7c6e29f29c 100755 --- a/model/api/src/main/java/org/keycloak/models/utils/RepresentationToModel.java +++ b/model/api/src/main/java/org/keycloak/models/utils/RepresentationToModel.java @@ -62,7 +62,7 @@ public class RepresentationToModel { else newRealm.setAccessTokenLifespan(300); if (rep.getSsoSessionIdleTimeout() != null) newRealm.setSsoSessionIdleTimeout(rep.getSsoSessionIdleTimeout()); - else newRealm.setSsoSessionIdleTimeout(600); + else newRealm.setSsoSessionIdleTimeout(1800); if (rep.getSsoSessionMaxLifespan() != null) newRealm.setSsoSessionMaxLifespan(rep.getSsoSessionMaxLifespan()); else newRealm.setSsoSessionMaxLifespan(36000); diff --git a/services/src/main/java/org/keycloak/services/managers/ApplianceBootstrap.java b/services/src/main/java/org/keycloak/services/managers/ApplianceBootstrap.java index cf5978fe4c..655b14896e 100755 --- a/services/src/main/java/org/keycloak/services/managers/ApplianceBootstrap.java +++ b/services/src/main/java/org/keycloak/services/managers/ApplianceBootstrap.java @@ -49,7 +49,7 @@ public class ApplianceBootstrap { realm.setName(adminRealmName); realm.setEnabled(true); realm.addRequiredCredential(CredentialRepresentation.PASSWORD); - realm.setSsoSessionIdleTimeout(300); + realm.setSsoSessionIdleTimeout(1800); realm.setAccessTokenLifespan(60); realm.setSsoSessionMaxLifespan(36000); realm.setAccessCodeLifespan(60); diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/oauth/RefreshTokenTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/oauth/RefreshTokenTest.java index fcd51b3225..ca4b7eee08 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/oauth/RefreshTokenTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/oauth/RefreshTokenTest.java @@ -139,7 +139,7 @@ public class RefreshTokenTest { Assert.assertThat(token.getExpiration() - Time.currentTime(), allOf(greaterThanOrEqualTo(250), lessThanOrEqualTo(300))); int actual = refreshToken.getExpiration() - Time.currentTime(); - Assert.assertThat(actual, allOf(greaterThanOrEqualTo(559), lessThanOrEqualTo(600))); + Assert.assertThat(actual, allOf(greaterThanOrEqualTo(1799), lessThanOrEqualTo(1800))); Assert.assertEquals(sessionId, refreshToken.getSessionState()); diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlBindingTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlBindingTest.java index 302fc91b4a..6c104fbbed 100755 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlBindingTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/saml/SamlBindingTest.java @@ -71,8 +71,7 @@ public class SamlBindingTest { @WebResource protected LoginPage loginPage; - @Test - @Ignore + //@Test public void runit() throws Exception { Thread.sleep(10000000); }