Define Meta Data for JWT Authentication

How to configure meta data for JWT authentication

Meta data is a mechanism included in the new MongoDB Realm JWT product that can be used to attach information about the user at time of onboarding to the JWT authentication token. For more information about meta data fields as they relate to MongoDB Realm JWT providers, please consult the following link MongoDB JWT Meta Data Fields.

Lastly, the developer needs to define the meta data fields to match the metadata fields that were defined in the Cosync JWT portal for the application. For example, if the meta data definitions in the Cosync JWT portal were as follows:


Then the Cosync Portal configuration process would create matching meta data field definitions in the MongoDB Realm portal section under the JWT Provider section


The email meta data field is added if the developer selects Automatically add email field to meta-data with handle. It is often very useful to be able to retrieve the authenticating email handle from within the client application, as MongoDB Realm provides no built in mechanism for doing so through its runtime API.

The CosyncJWT service also allows for specific meta-data fields to be attached to an invitation onboarding event. This is what the Invite Metadata Fields section provides. For example, invite meta-data might contain a coupon code used by the client application for users on-boarded through the invite mechanism.