title: Flutter App: cannot login with Google because the app does not match security policies OAuth 2.0
body: <p>i am developing a android app with Flutter but, when i try to log in with google to retrieve all events from Google Calendar, the app deploys an error 400: invalid_request. What can i do to my app match security policies (OAuth 2.0)?</p>
  <p>Check the link with error printscreen.</p>
  <pre><code>Future&lt;void&gt; main() async {
    WidgetsFlutterBinding.ensureInitialized();
    await Firebase.initializeApp(
      options: DefaultFirebaseOptions.currentPlatform,
    );
  
    var _clientID = ClientId(Secret.getId(), &quot;&quot;);
    const _scopes = [gCalendar.CalendarApi.calendarScope];
    AuthClient c = await clientViaUserConsent(_clientID, _scopes, prompt);
    signInWithGoogle(c);
    await FirebaseAuth.instance.signInAnonymously();
    runApp(const MyApp());
  }
  
  void prompt(String urla) async {
    Uri url = Uri.parse(urla);
    if (await launchUrl(url)) {
      print(
          &quot;FUNFAOIFNOAIFNAPOIFNMAPEOFEAPIOFNPAEOIFJAPEIOFPEOJFPOAFJAPEOFJAPEOFJAPEOFJAOEIJFNP OIWNFR WIOAN COPIWAHNFKAWHFIWAJFHK&quot;);
    } else {
      print('XXXXXXXXCould not launch $url');
    }
  }
  
  final GoogleSignIn _googleSignIn = GoogleSignIn(
    scopes: &lt;String&gt;[
      gCalendar.CalendarApi.calendarScope,
    ],
  );
  
  signInWithGoogle(AuthClient c) async {
    await _googleSignIn.signIn();
    final headers = await _googleSignIn.currentUser.authHeaders;
    getEvent(headers, connectedVmServiceUri);
  }
  
  getEvent(headers, c) async {
    var calendar = gCalendar.CalendarApi(c);
    DateTime lastMonth = DateTime.utc(2022, 6, 1);
    DateTime firstMonth = DateTime.utc(2122, 6, 1);
    var calEvents =
        calendar.events.list(&quot;primary&quot;, timeMax: lastMonth, timeMin: firstMonth);
    calEvents.then((events) =&gt;
        {events.items!.forEach((event) =&gt; print(&quot;EVENT: ${event.summary}&quot;))});
  }
  
  </code></pre>
  <p><a href="https://i.stack.imgur.com/WRnN0.png" rel="noreferrer">Error printscreen</a></p>