0

I am trying to configure the Azure AD B2C application for react native and using this lib for react-native. when trying to call init() it gives error Cannot read property 'createPublicClientApplication' of null. error screenshot

below is the MSAL config

auth: {
    clientId: 'fc8ecae3-0883-45f4-ac1c-013dfa11cb9c',
    authorityBase: 'https://stashcafe.b2clogin.com/tfp/stashcafe.onmicrosoft.com',
    policies: {
      signInSignUp: 'B2C_1_SignInUp',
      passwordReset: 'B2C_1_PasswordReset',
    },
    // redirectUri: Platform.select({ default: undefined }),
  },
  // web only:
  cache: { cacheLocation: 'localStorage' },

export const b2cScopes = ['https://stashcafe.onmicrosoft.com/api/user_impersonation'];

I have tried to add my own azure AD config but still same error.

vimuth
  • 5,064
  • 33
  • 79
  • 116
Nandan
  • 1
  • 3
  • This usually happens when you miss a step while installation. Maybe try following the installation docs again? https://github.com/stashenergy/react-native-msal#install – Ajay Gupta Jun 02 '23 at 05:30
  • There is also additional setup required: https://github.com/stashenergy/react-native-msal/blob/master/docs/android_setup.md – Ajay Gupta Jun 02 '23 at 05:31

1 Answers1

0

run

npm cache clean --force  

and

npm install
Harsh Mangalam
  • 1,116
  • 1
  • 10
  • 19