How to Integrate Microsoft and Clever SSO with MongoDB Realm Authentication Provider?

'm working on integrating Microsoft SSO and Clever SSO into a MongoDB Realm application as authentication providers. I want users to authenticate using either Microsoft or Clever SSO and manage their sessions seamlessly.

Here are a few specific questions I have:

  1. What are the steps to configure Microsoft Azure Active Directory (AAD) with MongoDB Realm for SSO?
  2. How do I set up Clever SSO to work as an external authentication provider in MongoDB Realm?
  3. Can I use both Microsoft and Clever SSO simultaneously in the same MongoDB Realm app? If so, how does MongoDB Realm differentiate between the providers?
  4. How do I map user attributes (like name and email) from Microsoft and Clever to MongoDB Realm user data?
  5. What are the security best practices for integrating these two SSO providers?

Additionally, if there are specific considerations for token handling, error handling, or managing user roles/permissions in this setup, I’d appreciate insights on those as well.

Any detailed guidance, example configurations, or relevant documentation links would be greatly appreciated!