How to prevent synchronizing data in user attribute from the second login with identity providers

Hi everyone,

As you may all know, Keycloak supports us to map user data from identity providers by user attribute importer. These attributes always get updated/synchronized when something changes in the identity provider responses every time we log in. But I have a requirement that from the second login on, which means after the user data is successfully mapped from the identity provider in the first login, we need to skip the synchronization.

Is there any way to achieve this with Keycloak (I’m using the version 4.6.0)? I took a look at the available SPIs, but it seems that none of them is helpful in this case, do you have any idea about this?