Search in sources :

Example 51 with ProtocolMapperModel

use of org.keycloak.models.ProtocolMapperModel in project keycloak by keycloak.

the class RoleNameMapper method create.

public static ProtocolMapperModel create(String name, String role, String newName) {
    String mapperId = PROVIDER_ID;
    ProtocolMapperModel mapper = new ProtocolMapperModel();
    mapper.setName(name);
    mapper.setProtocolMapper(mapperId);
    mapper.setProtocol(SamlProtocol.LOGIN_PROTOCOL);
    Map<String, String> config = new HashMap<String, String>();
    config.put(ROLE_CONFIG, role);
    config.put(NEW_ROLE_NAME, newName);
    mapper.setConfig(config);
    return mapper;
}
Also used : HashMap(java.util.HashMap) ProtocolMapperModel(org.keycloak.models.ProtocolMapperModel)

Aggregations

ProtocolMapperModel (org.keycloak.models.ProtocolMapperModel)51 HashMap (java.util.HashMap)22 ClientModel (org.keycloak.models.ClientModel)7 Path (javax.ws.rs.Path)6 NoCache (org.jboss.resteasy.annotations.cache.NoCache)6 LinkedList (java.util.LinkedList)5 List (java.util.List)5 ProviderConfigProperty (org.keycloak.provider.ProviderConfigProperty)5 ArrayList (java.util.ArrayList)4 Map (java.util.Map)4 NotFoundException (javax.ws.rs.NotFoundException)4 ClientScopeModel (org.keycloak.models.ClientScopeModel)4 KeycloakSession (org.keycloak.models.KeycloakSession)4 RealmModel (org.keycloak.models.RealmModel)4 RoleModel (org.keycloak.models.RoleModel)4 UserModel (org.keycloak.models.UserModel)4 IDToken (org.keycloak.representations.IDToken)4 ProtocolMapperRepresentation (org.keycloak.representations.idm.ProtocolMapperRepresentation)4 IOException (java.io.IOException)3 MigrationProvider (org.keycloak.migration.MigrationProvider)3