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
51 stars 50 forks source link

White screen when authenticating #70

Closed Sinan-Karakaya closed 12 months ago

Sinan-Karakaya commented 1 year ago

Describe the bug

When opening a url for me to authenticate to, the external chrome tab stays white, thus preventing me from authenticating myself.

To Reproduce

Steps to reproduce the behavior: Trigger this function

Future<void> SpotifyLogin() async {
    String url = "https://accounts.spotify.com/authorize?client_id=$spotifyClientID&redirect_uri=area&scope=user-read-currently-playing&response_type=token&state=123";

    final result = await FlutterWebAuth2.authenticate(url: url, callbackUrlScheme: "area");
    final token = Uri.parse(result).queryParameters["token"];
    if (kDebugMode) {
      print(token);
    }
  }

Expected behavior

It should open the webview of the Spotify login page, and send me my token back.

Screenshots

image

Device (please complete the following information!)

Additional context

I did added the Internet permission (correctly if SO is to be believed) as this was my first guess

Checklist

ThexXTURBOXx commented 1 year ago

If I open your provided authorization URL (with a valid client ID), I get told that your redirect URL is invalid. Try to change this "area" to a valid URL like "area://callback"

ThexXTURBOXx commented 12 months ago

Loading webpages is handled by Chrome Custom Tabs. If there is a problem with that, try asking on StackOverflow instead.