Hi,
I am new to using realm and I would like to know how I could integrate keycloak with openid in mongo atlas, to add permissions on collections in mongo atlas using the roles that my users have in keycloak.
Hi,
I am new to using realm and I would like to know how I could integrate keycloak with openid in mongo atlas, to add permissions on collections in mongo atlas using the roles that my users have in keycloak.
For clarity, a realm in Keycloak is unrelated to MongoDB Realm - they are two different things.
Just mentioning it to ensure the question is about MongoDB Realm - the database and not a keycloak realm which is used to manage a set of users, credentials, roles, and groups.
Hi @Jay,
Excuse me, I want uses custom jwt authentication with keycloak. At the moment I am working with realm and sync with mongo atlas.
Hi @Fabian_Eduardo_Diaz_Lizcano!
I hope your project is going well.
I suppose you can extract somehow the roles from Keycloak JWT in Flutter. Then you can import the roles as user.customData for your App Service users. These data are integrated in the token issued by Atlas once the user is authenticated. We have an example about using customData roles for setting users permissions rules.
Here is the code that creates the roles. And here is an extension on User that returns the role from the customData of the current user.
You can find the App service configuration files in users_permissions/assets/atlas_app folder. You can check in the Readme.md how to configure the App Service.