0

I'm trying to implement login with microsoft in my react native application

I am using the lib "react-native-msal" for it.

on IOS is working correctly

but on android i'm having this error:

[Error: Attempt to invoke interface method 'com.facebook.react.bridge.ReadableArray com.facebook.react.bridge.ReadableMap.getArray(java.lang.String)' on a null object reference]

the error happens here:

let config: MSALConfiguration = null;

  if (Platform.OS === 'ios') {
    config = {
      auth: {
        clientId: 'my_client_id',
        authority:
          'url_here',
        redirectUri: 'url_here',
      },
    };
  } else {
    config = {
      auth: {
        clientId: 'my_client_id',
        authorization_user_agent: 'DEFAULT',
        authority:
          'url_here',
        redirectUri: 'url_here',
        authorities: [
          {
            type: 'AAD',
            audience: {
              type: 'AzureADMyOrg',
              tenant_id: 'ID_HERE',
            },
          },
        ],
      },
    };
  }

const pca = new PublicClientApplication(config, false);

  try {
    await pca.init();
    const user = await pca.acquireToken(); // I think the error happens with this line

Paulo Rodrigues
  • 381
  • 4
  • 13

0 Answers0