Search code examples
react-nativesingle-sign-onazure-authentication

What packages are there for Azure MSAL for React Native?


I've been looking for packages to use to enable MS Auth in a React Native app.

One feature we would like is to automatically authenticate the user once they have logged in (possibly from another app or website).

I have found react-native-msal but it hasn't been updated in the last 2 years and their github repo is archived.

Also does @azure/msal-react supposed work with React Native?

Are there any recent packages out there that allows this functionality next to SSO?


Solution

  • Your best option at this point will be to:

    1. Use any other OpenID Connect OAuth Library, Microsoft’s APIs are standards compliant, you can use other libraries and work with Microsoft. I use https://github.com/FormidableLabs/react-native-app-auth
    2. Take the react-native-msal and try and use it. If there are issues you will have to update the code and make it work.
    3. You can use we WebView to handle the authentication flow. This method isn’t the most native-feeling, but it can be effective. After authentication, you can store tokens securely (e.g., using react-native-sensitive-info) and use them for subsequent requests.