Search in sources :

Example 41 with StorageId

use of org.keycloak.storage.StorageId in project keycloak by keycloak.

the class HardcodedClientStorageProvider method getClientById.

@Override
public ClientModel getClientById(RealmModel realm, String id) {
    StorageId storageId = new StorageId(id);
    final String clientId = storageId.getExternalId();
    if (this.clientId.equals(clientId))
        return new ClientAdapter(realm);
    return null;
}
Also used : StorageId(org.keycloak.storage.StorageId)

Example 42 with StorageId

use of org.keycloak.storage.StorageId in project keycloak by keycloak.

the class HardcodedRoleStorageProvider method getRoleById.

@Override
public RoleModel getRoleById(RealmModel realm, String id) {
    StorageId storageId = new StorageId(id);
    final String roleName = storageId.getExternalId();
    if (this.roleName.equals(roleName))
        return new HardcodedRoleAdapter(realm);
    return null;
}
Also used : StorageId(org.keycloak.storage.StorageId)

Example 43 with StorageId

use of org.keycloak.storage.StorageId in project keycloak by keycloak.

the class UserMapStorage method getUserById.

@Override
public UserModel getUserById(RealmModel realm, String id) {
    StorageId storageId = new StorageId(id);
    final String username = storageId.getExternalId();
    if (!userPasswords.containsKey(translateUserName(username))) {
        return null;
    }
    return createUser(realm, username);
}
Also used : StorageId(org.keycloak.storage.StorageId)

Example 44 with StorageId

use of org.keycloak.storage.StorageId in project keycloak by keycloak.

the class UserPropertyFileStorage method getUserById.

@Override
public UserModel getUserById(RealmModel realm, String id) {
    StorageId storageId = new StorageId(id);
    final String username = storageId.getExternalId();
    if (!userPasswords.containsKey(username))
        return null;
    return createUser(realm, username);
}
Also used : StorageId(org.keycloak.storage.StorageId)

Aggregations

StorageId (org.keycloak.storage.StorageId)44 UserModel (org.keycloak.models.UserModel)7 RealmModel (org.keycloak.models.RealmModel)6 ComponentModel (org.keycloak.component.ComponentModel)5 ClientModel (org.keycloak.models.ClientModel)5 ClientScopeModel (org.keycloak.models.ClientScopeModel)5 List (java.util.List)3 Objects (java.util.Objects)3 Stream (java.util.stream.Stream)3 Test (org.junit.Test)3 KeycloakSession (org.keycloak.models.KeycloakSession)3 ModelException (org.keycloak.models.ModelException)3 UserConsentModel (org.keycloak.models.UserConsentModel)3 Collection (java.util.Collection)2 Collections (java.util.Collections)2 HashMap (java.util.HashMap)2 Map (java.util.Map)2 Set (java.util.Set)2 Function (java.util.function.Function)2 Predicate (java.util.function.Predicate)2