Search in sources :

Example 1 with UserLookupProvider

use of org.keycloak.storage.user.UserLookupProvider in project keycloak by keycloak.

the class UserStorageManager method getUserById.

/**
 * {@link UserRegistrationProvider} methods implementations end here
 *        {@link UserLookupProvider} methods implementations start here
 */
@Override
public UserModel getUserById(RealmModel realm, String id) {
    StorageId storageId = new StorageId(id);
    if (storageId.getProviderId() == null) {
        UserModel user = localStorage().getUserById(realm, id);
        return importValidation(realm, user);
    }
    UserLookupProvider provider = getStorageProviderInstance(realm, storageId.getProviderId(), UserLookupProvider.class);
    if (provider == null)
        return null;
    return provider.getUserById(realm, id);
}
Also used : UserModel(org.keycloak.models.UserModel) CachedUserModel(org.keycloak.models.cache.CachedUserModel) UserLookupProvider(org.keycloak.storage.user.UserLookupProvider)

Aggregations

UserModel (org.keycloak.models.UserModel)1 CachedUserModel (org.keycloak.models.cache.CachedUserModel)1 UserLookupProvider (org.keycloak.storage.user.UserLookupProvider)1