ThexXTURBOXx / flutter_web_auth_2

Flutter plugin for authenticating a user with a web service
https://pub.dev/packages/flutter_web_auth_2
MIT License
53 stars 54 forks source link

White Screen when trying to authenticate with Azure AD #71

Closed OzyOzk closed 1 year ago

OzyOzk commented 1 year ago

Describe the bug

My Azure login page isn't loading when I try to authenticate with Azure AD.

To Reproduce

class AzureAuthentication{
  String authority = "login.microsoftonline.com";
  String redirect = "https://login.live.com/oauth20_desktop.srf";
  void authenticate() async {
    final redirect_uri = Uri.parse(redirect);
    final red = redirect_uri.toString();
    final url = Uri.https(authority, "/$tennant_id/oauth2/v2.0/authorize/", {
      'response_type': 'code',
      'client_id': client_id,
      'redirect_uri': redirect,
      'scope': 'openid'
    });
    print("1");
    final res = await FlutterWebAuth2.authenticate(url: url.toString(), callbackUrlScheme: "https");
    print("2");
    final code = Uri.parse(res).queryParameters['code'];
    print(code);
  }

}

Expected behavior

The page should load the MS Azure Login page

Screenshots

If applicable, add screenshots to help explain your problem.

Device (please complete the following information!)

Additional context

Not sure what the redirect URL scheme is for AD. Haven't found anything online around this library and Azure

Checklist

ThexXTURBOXx commented 1 year ago

Loading web pages is handled by Chrome Custom Tabs. If there is a problem with loading a page, it is not an issue with this package. Try asking on StackOverflow.