Search code examples
react-nativeoauth-2.0firebase-authenticationazure-active-directory

Microsoft authentification with Firebase React-Native


I am currently implementing a Firebase React Native connection with Microsoft. But on https://rnfirebase.io/auth/social-auth , there is no section on Microsoft. I searched the documentation https://firebase.google.com/docs/auth/android/microsoft-oauth But I find it difficult to understand. I'm just trying to make a connection, nothing else.


Solution

  • You can make a connection with Microsoft Azure AD with Firebase React Native application.

    Please follow the below steps to get this implemented.

    To sign in users using Microsoft accounts (Azure Active Directory and personal Microsoft accounts), you must first enable Microsoft as a sign-in provider for your Firebase project:

    1. Add Firebase to your Android project.

    2. In the Firebase console, open the Auth section.

    3. On the Sign in method tab, enable the Microsoft provider.

    4. Add the Client ID and Client Secret from that provider's developer console to the provider configuration:

    5. To register a Microsoft OAuth client, follow the instructions in Quickstart: Register an app with the Azure Active Directory v2.0 endpoint. Note that this endpoint supports sign-in using Microsoft personal accounts as well as Azure Active Directory accounts. Learn more about Azure Active Directory v2.0.

    6. When registering apps with these providers, be sure to register the *.firebaseapp.com domain for your project as the redirect domain for your app.

    7. Click Save.

    8. If you haven't yet specified your app's SHA-1 fingerprint, do so from the Settings page of the Firebase console. Refer to Authenticating Your Client for details on how to get your app's SHA-1 fingerprint.

    Reference: Authenticate Using Microsoft on Android | Firebase Documentation (google.com)

    You Can also refer this document for more clarification : https://medium.com/seed-digital/using-microsoft-azure-identity-with-firebase-in-a-react-native-app-c9eef0fd0af8