use of org.keycloak.representations.idm.ProtocolMapperRepresentation in project keycloak by keycloak.
the class ClientMappersSAMLTest method testRoleList.
@Test
public void testRoleList() {
// create
clientMappersPage.mapperTable().createMapper();
setInitialValues("new role list");
createClientMappersPage.form().setMapperType(ROLE_LIST);
createClientMappersPage.form().setRoleAttributeName("role attribute name");
createClientMappersPage.form().setFriendlyName("friendly name");
createClientMappersPage.form().setSamlAttributeNameFormat("URI Reference");
createClientMappersPage.form().setSingleRoleAttribute(true);
createClientMappersPage.form().save();
assertAlertSuccess();
// check
ProtocolMapperRepresentation found = findClientMapperByName(id, "new role list");
assertNotNull(found);
assertEquals("saml-role-list-mapper", found.getProtocolMapper());
Map<String, String> config = found.getConfig();
assertEquals("role attribute name", config.get("attribute.name"));
assertEquals("URI Reference", config.get("attribute.nameformat"));
assertEquals("friendly name", config.get("friendly.name"));
assertEquals("true", config.get("single"));
}
use of org.keycloak.representations.idm.ProtocolMapperRepresentation in project keycloak by keycloak.
the class ClientMappersOIDCTest method testUserAttribute.
@Test
public void testUserAttribute() {
// create
clientMappersPage.mapperTable().createMapper();
setInitialValues("user attribute");
createClientMappersPage.form().setMapperType(USER_ATTRIBUTE);
createClientMappersPage.form().setUserAttribute("user attribute");
createClientMappersPage.form().setMultivalued(true);
createClientMappersPage.form().save();
assertAlertSuccess();
// check
ProtocolMapperRepresentation found = findClientMapperByName(id, "user attribute");
assertEquals("oidc-usermodel-attribute-mapper", found.getProtocolMapper());
Map<String, String> config = found.getConfig();
assertEquals("true", config.get("multivalued"));
assertEquals("user attribute", config.get("user.attribute"));
}
use of org.keycloak.representations.idm.ProtocolMapperRepresentation in project keycloak by keycloak.
the class ClientMappersOIDCTest method testUserSessionNote.
@Test
public void testUserSessionNote() {
// create
clientMappersPage.mapperTable().createMapper();
setInitialValues("user session note");
createClientMappersPage.form().setMapperType(USER_SESSION_NOTE);
createClientMappersPage.form().setUserSessionNote("session note");
createClientMappersPage.form().setTokenClaimName("claim name");
createClientMappersPage.form().setClaimJSONType("int");
createClientMappersPage.form().setAddToIDToken(false);
createClientMappersPage.form().setAddToAccessToken(false);
createClientMappersPage.form().save();
assertAlertSuccess();
// check
ProtocolMapperRepresentation found = findClientMapperByName(id, "user session note");
assertNotNull(found);
assertEquals("oidc-usersessionmodel-note-mapper", found.getProtocolMapper());
Map<String, String> config = found.getConfig();
assertEquals("claim name", config.get("claim.name"));
assertEquals("session note", config.get("user.session.note"));
assertEquals("int", config.get("jsonType.label"));
}
use of org.keycloak.representations.idm.ProtocolMapperRepresentation in project keycloak by keycloak.
the class ClientMappersOIDCTest method testUserAddress.
@Test
public void testUserAddress() {
// create
clientMappersPage.mapperTable().createMapper();
setInitialValues("user address");
createClientMappersPage.form().setMapperType(USERS_FULL_NAME);
createClientMappersPage.form().save();
assertAlertSuccess();
// check
ProtocolMapperRepresentation found = findClientMapperByName(id, "user address");
assertEquals("oidc-full-name-mapper", found.getProtocolMapper());
}
use of org.keycloak.representations.idm.ProtocolMapperRepresentation in project keycloak by keycloak.
the class ClientMappersOIDCTest method testGroupMembership.
@Test
public void testGroupMembership() {
// create
clientMappersPage.mapperTable().createMapper();
setInitialValues("group membership");
createClientMappersPage.form().setMapperType(GROUP_MEMBERSHIP);
createClientMappersPage.form().setFullGroupPath(true);
createClientMappersPage.form().save();
assertAlertSuccess();
// check
ProtocolMapperRepresentation found = findClientMapperByName(id, "group membership");
assertEquals("oidc-group-membership-mapper", found.getProtocolMapper());
Map<String, String> config = found.getConfig();
assertEquals("true", config.get("full.path"));
}
Aggregations