Autodelete User KeyCloak SSO

Hi there,

we use KeyCloak as SSO Client and Social Login to map groups and roles to a user.

Now we try to find a solution that users which are not within the KeyCloak database anymore get deleted automatically from NextCloud.

Do you have any clue where to start?

Thanks and regards

Benny :slight_smile:

hi @Benjamin_Dieckmann welcome to Nextcloud Forum :handshake:

the problem relates to social login app and is better placed in their support channel (Github issue?)

I’m unsure it’s possible to auto-remove users once they disappear from SSO provider DB (as NC has no access to SSO provider DB - the process work “other direction” from SSO to NC)… and I’m not confident the maintainer of the app is willing to support this requirement - he even declines to implement auto-match of SSO users with existing NC users…

A generic approach could be to remove the NC user within same process you remove the user from KC. you can run occ scripts or use provisioning API, whatever matches your skills and preferences. but you must be aware removing a user from NC removes all the data as well - take care of shared docs etc…