Custom Function Authentication

The Custom Function authentication provider allows you to use a Realm Function to implement your own user authentication logic or flexibly integrate an external authentication system. You can use the Custom Function provider to integrate with any authentication system as long as the system maintains a unique ID value for each user.

The authentication function is a Realm Function that you define to handle authentication logic for users that log in with the Custom Function provider. You can use the function to coordinate with an external authentication system and/or use data that you store in MongoDB to identify and authenticate users.

Validate and Authenticate Custom Function Users

Realm does not perform any data validation or authentication checks for the Custom Function provider. Make sure that you validate incoming data and that your authentication system performs appropriate authentication checks, such as requiring a password, two factor authentication, or a single sign-on token.

For code examples that demonstrate how to register and log in using Custom Function authentication, see the documentation for the Realm SDKs:

  • Custom Function authentication allows you to define your authentication process in a Realm Function.
  • The Realm Function that you use for authentication should return a unique ID for each user based on the information passed from the client SDK.
Give Feedback

On this page