launchWebAuthFlow method

Future<String?> launchWebAuthFlow(
  1. WebAuthFlowDetails details
)

Starts an auth flow at the specified URL.

This method enables auth flows with non-Google identity providers by launching a web view and navigating it to the first URL in the provider's auth flow. When the provider redirects to a URL matching the pattern https://<app-id>.chromiumapp.org/*, the window will close, and the final redirect URL will be passed to the callback function.

For a good user experience it is important interactive auth flows are initiated by UI in your app explaining what the authorization is for. Failing to do this will cause your users to get authorization requests with no context. In particular, do not launch an interactive auth flow when your app is first launched.

|details| : WebAuth flow options. |callback| : Called with the URL redirected back to your application.

Implementation

Future<String?> launchWebAuthFlow(WebAuthFlowDetails details) async {
  var $res = await promiseToFuture<String?>(
      $js.chrome.identity.launchWebAuthFlow(details.toJS));
  return $res;
}