aad_oauth icon indicating copy to clipboard operation
aad_oauth copied to clipboard

Stuck on oauth.login()

Open sjordan2010 opened this issue 1 year ago • 3 comments

I have 3 different apps that use aad_oauth package, and they all are experiencing the same issue.

The app builds and opens. But when I click login, it gets stuck forever on the "loader" screen with no error messages or anything. I never make it to the actual Microsoft login page. This wasn't the case until recently.

I have tried iOS 15, 17, and 18 simulators. I have tried to downgrade Flutter, using different versions of this along with other packages, clean all the builds, completely reset the simulators, all to no avail.

##Config / Setup:

class AccountScreenState extends State<AccountScreen> {
  AccountScreenState(this.reset);
  late AppConfig config;

  static final aad_config.Config aadConfig = aad_config.Config(
      tenant: "xxx",
      clientId: "xxx",
      scope: "openid profile offline_access",
      redirectUri: "https://login.live.com/oauth20_desktop.srf",
      navigatorKey: navigatorKey,
      webUseRedirect: true,
      loader: const Center(child: CircularProgressIndicator()));
  final AadOAuth oauth = AadOAuth(aadConfig);

##Login function

   void login() async {
    try {
      setState(() {
        _message = "Attempting to sign you in, please wait.";
        _buttonOrLoad = buttonOrLoading(false);
      });

      //Check AAD
      print('before'); // THIS ALWAYS FIRES
      await oauth.login();
      print('after');  // THIS NEVER FIRES

sjordan2010 avatar Jan 08 '25 03:01 sjordan2010

i have the same problem, it runs fine on ios, but on some android devices it has problems

vanhcoder avatar Feb 03 '25 02:02 vanhcoder

i have the same problem, but only occur in some devices. it's hard to trace as not all devices experience the same plus there is no log from the library

victoriavhe avatar Feb 17 '25 06:02 victoriavhe

I found this issue. It's probably related

Breizhhh avatar Feb 17 '25 13:02 Breizhhh