Hi @Benxy You can use zitadel actions to get that functionality. Zitadel actions are javascript snippets you can run at a certain place, in your usecase, you could add the groups to the user metadata, and then add them to the token from the user metadata.
Let me know how it goes, also if get it running. I believe this might be something relevant to others as well. We do have an actions repository where we collect examples. You could contribute your example there: https://github.com/zitadel/actions