Search code examples
flutterkeygoogle-calendar-apicredentials

Where do I get "private_key_id" and "private_key"?


I'm not able to find "private_key_id" and "private_key" in the Google consele.

import 'package:googleapis_auth/auth_io.dart';
import 'package:googleapis/calendar/v3.dart' as v3;

class _MyHomePageState extends State<MyHomePage> {

  final accountCredentials = new ServiceAccountCredentials.fromJson(
    {
    "private_key_id": "562ab...",
    "private_key": "-----BEGIN PRIVATE KEY--............----END PRIVATE KEY-----\n",
    "client_email": "xxx@xxx.iam.gserviceaccount.com",
    "client_id": "1073.......",
    "type": "service_account",
    "project_id": "myapi"
   }
  );
}

Solution

  • Go to Menu > APIs & Services > Credentials

    enter image description here

    There you can see all the keys and credentials

    enter image description here