use of org.keycloak.representations.AccessTokenResponse in project keycloak by keycloak.
the class UserInfoTest method testRolesAreAvailable_getMethod_header.
@Test
public void testRolesAreAvailable_getMethod_header() throws Exception {
switchIncludeRolesInUserInfoEndpoint(true);
Client client = AdminClientUtil.createResteasyClient();
try {
AccessTokenResponse accessTokenResponse = executeGrantAccessTokenRequest(client);
Response response = UserInfoClientUtil.executeUserInfoRequest_getMethod(client, accessTokenResponse.getToken());
UserInfo userInfo = testSuccessfulUserInfoResponse(response);
testRolesInUserInfoResponse(userInfo);
} finally {
client.close();
switchIncludeRolesInUserInfoEndpoint(false);
}
}
use of org.keycloak.representations.AccessTokenResponse in project keycloak by keycloak.
the class UserInfoTest method testSuccess_postMethod_body.
@Test
public void testSuccess_postMethod_body() throws Exception {
Client client = AdminClientUtil.createResteasyClient();
try {
AccessTokenResponse accessTokenResponse = executeGrantAccessTokenRequest(client);
Form form = new Form();
form.param("access_token", accessTokenResponse.getToken());
WebTarget userInfoTarget = UserInfoClientUtil.getUserInfoWebTarget(client);
Response response = userInfoTarget.request().post(Entity.form(form));
testSuccessfulUserInfoResponse(response);
} finally {
client.close();
}
}
use of org.keycloak.representations.AccessTokenResponse in project keycloak by keycloak.
the class UserInfoTest method testSessionExpiredOfflineAccess.
@Test
public void testSessionExpiredOfflineAccess() throws Exception {
Client client = AdminClientUtil.createResteasyClient();
try {
AccessTokenResponse accessTokenResponse = executeGrantAccessTokenRequest(client, true);
testingClient.testing().removeUserSessions("test");
Response response = UserInfoClientUtil.executeUserInfoRequest_getMethod(client, accessTokenResponse.getToken());
testSuccessfulUserInfoResponse(response);
response.close();
} finally {
client.close();
}
}
Aggregations