0

我正在尝试在我的反应本机应用程序中使用 microsoft 实现登录

我正在使用库“react-native-msal”。

在 IOS 上工作正常

但是在android上我遇到了这个错误:

[错误:尝试在空对象引用上调用接口方法'com.facebook.react.bridge.ReadableArray com.facebook.react.bridge.ReadableMap.getArray(java.lang.String)']

错误发生在这里:

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

4

0 回答 0