KEYCLOAK-5326 Test that userSession is still the same after prompt=login
This commit is contained in:
parent
bb9a1335ec
commit
30d8a7503b
1 changed files with 5 additions and 5 deletions
|
@ -282,8 +282,7 @@ public class OIDCAdvancedRequestParamsTest extends AbstractTestRealmKeycloakTest
|
|||
Assert.assertEquals(AppPage.RequestType.AUTH_RESPONSE, appPage.getRequestType());
|
||||
|
||||
EventRepresentation loginEvent = events.expectLogin().detail(Details.USERNAME, "test-user@localhost").assertEvent();
|
||||
IDToken idToken = sendTokenRequestAndGetIDToken(loginEvent);
|
||||
int authTime = idToken.getAuthTime();
|
||||
IDToken oldIdToken = sendTokenRequestAndGetIDToken(loginEvent);
|
||||
|
||||
// Set time offset
|
||||
setTimeOffset(10);
|
||||
|
@ -296,12 +295,13 @@ public class OIDCAdvancedRequestParamsTest extends AbstractTestRealmKeycloakTest
|
|||
Assert.assertEquals(AppPage.RequestType.AUTH_RESPONSE, appPage.getRequestType());
|
||||
|
||||
loginEvent = events.expectLogin().detail(Details.USERNAME, "test-user@localhost").assertEvent();
|
||||
idToken = sendTokenRequestAndGetIDToken(loginEvent);
|
||||
int authTimeUpdated = idToken.getAuthTime();
|
||||
IDToken newIdToken = sendTokenRequestAndGetIDToken(loginEvent);
|
||||
|
||||
// Assert that authTime was updated
|
||||
Assert.assertTrue(authTime + 10 <= authTimeUpdated);
|
||||
Assert.assertTrue(oldIdToken.getAuthTime() + 10 <= newIdToken.getAuthTime());
|
||||
|
||||
// Assert userSession didn't change
|
||||
Assert.assertEquals(oldIdToken.getSessionState(), newIdToken.getSessionState());
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue