2

I'm using expo@4.5.2 and react-native-msal@4.0.0

I've copied the B2CClient class from b2cClient.ts provided in the example directory of react-native-msal and my initialization is set up the same as in App.tsx example provided as well (https://github.com/stashenergy/react-native-msal/tree/master/example/src). My configuration is the following:

  auth: {
    clientId: '<CLIENT_ID>',
    authorityBase: 'https://example.b2clogin.com/tfp/example.onmicrosoft.com',
    policies: {
      signInSignUp: 'B2C_1_mySignupPolicy',
      passwordReset: 'B2C_1_myPasswordResetPolicy',
    },
    redirectUri: Platform.select({
      android: 'msauth://com.company.app/l5rSw0yVmvlj7l5rSw0yWAYk5tfVb2j%2F',
      default: undefined,
    }),
  },

I've done the additional step for expo (https://github.com/stashenergy/react-native-msal/blob/master/docs/expo_setup.md). But I get a warning in my editor: Failed to resolve plugin for module "react-native-msal" (I'm using the same version of react-native-msal that was used when the setup example was written)

I can still build the app regardless of this warning. But when b2cClient.init() runs I get this error:

[TypeError: null is not an object (evaluating '_nativeModule.default.createPublicClientApplication')]

enter image description here

Supposedly this package should work with expo and my configuration is the same as the example. How do I fix this?

1 Answers1

0

I also forked this same project and received the error below. You should check your credentials: both Tenant ID and Client ID must be set to True.

Kyle F Hartzenberg
  • 2,567
  • 3
  • 6
  • 24