[keycloak-user] [dev] Search all users in a realm with a non-verified email?

Marek Posolda mposolda at redhat.com
Fri Jan 19 00:36:47 EST 2018


I think you're not wrong. ATM it's probably best to handle this at DB 
level. After you run the task, which directly updates DB, it might be 
needed to clear the userCache on Keycloak side, so the users, which were 
cached and deleted by your task will be deleted from the cache too. It's 
doable from admin console, but there is also REST endpoint to do this.

Marek

On 18/01/18 16:24, Tomás García wrote:
> Hi,
>
>   Using the userStorageManager, I don't think I could possibly get a
> collection of UserModels where all users are just those where the
> EMAIL_VERIFIED bit is set to 0, right?
>
>   If I'm wrong please let me know.
>
>   My use case is I'm creating a task to delete those users after a time as
> long as the realm is configured to verify the email. I managed to get the
> rest of the details right I think thanks to Marek Posolda, but I cannot
> find a way to search specifically those users, because gathering all users
> in memory and then iterating all the collection wouldn't be optimal. I'd
> rather let that job to be done by the persistence layer.
>
> Thanks.
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user




More information about the keycloak-user mailing list