[keycloak-dev] federated pagination Re: federation commited need feedback

Bill Burke bburke at redhat.com
Fri Jul 25 09:43:29 EDT 2014



On 7/25/2014 3:20 AM, Marek Posolda wrote:
>> You're right.  The API would have to change to note the provider that
>> was last used and how many were consumed for that provider.
>>
>> class Result {
>>
>>    List<UserModel> results;
>>
>>    String lastProvider;
>>    int lastIndex;
>>
>> }
>>
>> then UserProvider search would need these methods:
>>
>> Result search(criteria..., int maxResults);  // start from beginning
>> Result search(criteria..., String lastProvider, int lastIndex, int
>> maxResults);
> Sorry, I still have doubts;-)
>
> For example there are 10 users in Keycloak and just 5 of them are mapped
> to LDAP. In LDAP there are just those 5 users. Then you want to search
> for page1 with (lastIndex 0, maxResults 10) and you will retrieve those
> 10 Keycloak Users. Then you want page2, so you call (lastIndex 10,
> maxResults 10) and now you retrieve those 5 users from LDAP, but those
> are same users, which were already retrieved on page1.
>

Solved by searching for local users where federation link is null only? 
  The side effect is that the federation provider would also have to 
check the database to make sure the user hasn't already been imported. 
This could suck as 1 pagination query could turn into MAX_RESULTS local 
storage queries.


-- 
Bill Burke
JBoss, a division of Red Hat
http://bill.burkecentral.com


More information about the keycloak-dev mailing list