You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

React Native集成react-native-azure-auth登录窗口空白问题求助

React Native 微软认证流程空白白屏问题

我正在测试React Native(0.73.6)应用的认证流程,使用react-native-azure-auth(^1.8.9)库。登录函数可正常触发,会打开login.microsoftonline.com窗口,但始终显示空白白屏;关闭该空白窗口时会捕获到错误:aa.session.user_cancelled,错误描述为User cancelled the Auth。我已遵循react-native-azure-auth的文档操作,当前处于调试模式,预期窗口会显示微软登录页面,但未出现任何报错,仅显示空白。

相关代码如下:

import AzureAuth from 'react-native-azure-auth';

export const azureAuth = new AzureAuth({
  clientId: 'my client id',
  tenant: 'my tenant id',
});

export async function signIn() {
  try {
    let tokens = await azureAuth.webAuth.authorize({
      scope: 'openid profile User.Read Mail.Read',
    });
    console.log('tokens: ', tokens);
  } catch (error) {
    console.log(error);
  }
}

附模拟器截图:

  • 初始带登录按钮界面
  • 点击后弹出窗口
  • 空白登录窗口

内容的提问来源于stack exchange,提问作者swwjjj_ok

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.27 10:02:01