Hi Marek, Stian, Bill.... 

I have developed a custom user federation provider. I notice that Keycloak create several User Federation Providers during a single authentication flow callin KeycloakModelUtils.getFederationProviderInstance multiple times...

To prevent create two or three user federation providers per request, I need implement into my custom Federation Provider a logic for search an instance of my custom provider into the Keycloak session and if not exists then create a new one. So... there would be better do it into the method KeycloakModelUtils.getFederationProviderInstance?

People that implements a custom user federation providers... Do people need to create multiple instances per request of the same provider?


By the way, I have extended the keycloak SPI to perform use of infinispan cache when a custom user provider try to validate a user or get some data from a user federation provider during process. Maybe this could be useful to other users... if you wants to add this spi, I can try to prepare a pull request to you.


Thanks
-- 
Ariel Carrera