use of org.keycloak.representations.UserInfo in project keycloak by keycloak.
the class UserInfoTest method testSuccess_getMethod_header.
@Test
public void testSuccess_getMethod_header() throws Exception {
Client client = AdminClientUtil.createResteasyClient();
try {
AccessTokenResponse accessTokenResponse = executeGrantAccessTokenRequest(client);
Response response = UserInfoClientUtil.executeUserInfoRequest_getMethod(client, accessTokenResponse.getToken());
UserInfo userInfo = testSuccessfulUserInfoResponse(response);
testRolesAreNotInUserInfoResponse(userInfo);
} finally {
client.close();
}
}
use of org.keycloak.representations.UserInfo 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);
}
}
Aggregations