I use Keylcoak 8.0.1 to authenticate users for an existing web application.
I wrote a class implementing UserQueryProvider and UserLookupProvider for user resolution and password checks.
What do I have to do to assign roles defined in my custom datasource? Is there any interface to implement?
You should implement custom
org.keycloak.models.UserModel. This is your entry point for transferring changes to external DB. It could be adapter over user entity from your existing DB. Check out docs and default implementation from Keycloak sources.