Testing offline token exchange with exception only (scope without specific value)
This commit is contained in:
parent
22013667d1
commit
1cbfa034e7
|
@ -507,18 +507,20 @@ public class TestKeycloakClient {
|
|||
client.introspectAccessToken(DEV_ROOT_CONTEXT, CLIENT_ID, CLIENT_SECRET, exchangedTR.getAccessToken()));
|
||||
}
|
||||
|
||||
// @Test
|
||||
// public void test53ExchangeToken4Offline() throws Exception {
|
||||
// logger.info("*** [5.3] Start testing token exchange for offline token from Keycloak...");
|
||||
// KeycloakClient client = KeycloakClientFactory.newInstance();
|
||||
// TokenResponse oidcTR = client.queryOIDCTokenOfUser(DEV_ROOT_CONTEXT, CLIENT_ID, CLIENT_SECRET,
|
||||
// TEST_USER_USERNAME, TEST_USER_PASSWORD);
|
||||
//
|
||||
// logger.info("*** [5.3] OIDC access token: {}", oidcTR.getAccessToken());
|
||||
//
|
||||
// TokenResponse exchangedTR = client.exchangeTokenForOfflineToken(DEV_ROOT_CONTEXT, oidcTR.getAccessToken(),
|
||||
// CLIENT_ID, CLIENT_SECRET, CLIENT_ID);
|
||||
//
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void test53ExchangeToken4Offline() throws Exception {
|
||||
logger.info("*** [5.3] Start testing token exchange for offline token from Keycloak...");
|
||||
KeycloakClient client = KeycloakClientFactory.newInstance();
|
||||
TokenResponse oidcTR = client.queryOIDCTokenOfUser(DEV_ROOT_CONTEXT, CLIENT_ID, CLIENT_SECRET,
|
||||
TEST_USER_USERNAME, TEST_USER_PASSWORD);
|
||||
|
||||
logger.info("*** [5.3] OIDC access token: {}", oidcTR.getAccessToken());
|
||||
|
||||
// TokenResponse exchangedTR =
|
||||
client.exchangeTokenForOfflineToken(DEV_ROOT_CONTEXT, oidcTR.getAccessToken(),
|
||||
CLIENT_ID, CLIENT_SECRET, CLIENT_ID);
|
||||
|
||||
// For the moment this part is not covered by tests
|
||||
// logger.info("*** [5.3] Exchanged access token: {}", exchangedTR.getAccessToken());
|
||||
// logger.info("*** [5.3] Exchanged refresh token: {}", exchangedTR.getRefreshToken());
|
||||
// TestModelUtils.checkTokenResponse(exchangedTR, true);
|
||||
|
@ -526,8 +528,8 @@ public class TestKeycloakClient {
|
|||
//
|
||||
// TestModelUtils.checkTokenIntrospectionResponse(client.introspectAccessToken(DEV_ROOT_CONTEXT, CLIENT_ID,
|
||||
// CLIENT_SECRET, exchangedTR.getAccessToken()));
|
||||
//
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test6GetAvatar() throws Exception {
|
||||
|
|
Loading…
Reference in New Issue