Google Auth Setup Instructions on Marionette

Step 1: Google Cloud Console Setup

  1. Go to Google Cloud Console.

  2. Create a project if you don’t already have one.

  3. In the search bar (top center), type “Credentials” and select Credentials under “Products & Pages”.

  4. Click the Create Credentials button.

  5. Select OAuth Client ID from the pop-up window.

  6. Choose the appropriate Application Type (iOS, Web, or Android).

We will now proceed with platform-specific setup instructions.

 

Step 2: iOS Setup

  1. Select iOS under the Application Type dropdown.

  2. Enter a name (e.g., “iOS OAuth”) and your app’s Bundle ID (found in ios/Runner/Info.plist under the CFBundleIdentifier tag).

  3. Click the Create button.

Add to Info.plist:
<array> <dict> <key>CFBundleTypeRole</key> <string>Editor</string> <key>CFBundleURLSchemes</key> <array> <string>com.googleusercontent.apps.***YOUR_CLIENT_ID***</string> </array> </dict> </array>
  • Replace YOUR_CLIENT_ID with the generated Client ID.

 

Step 3: Web Setup

  1. Select Web application under the Application Type dropdown.

  2. Enter a name (e.g., “Web OAuth”).

  3. Add Authorized JavaScript origins and Authorized redirect URIs:

    • Use http://localhost for local debugging.

    • Use https://yourdomain.com for production.

  4. Click Create to generate your Client ID.

 

Step 4: Android Setup

  1. Select Android under the Application Type dropdown.

  2. Enter a name (e.g., “Android OAuth Debug” for debugging and “Android OAuth Release” for production).

Obtain SHA-1 Keys:
  1. Navigate to the android folder in your project:

    cd android
  2. Run the following command to generate SHA-1 keys:

    ./gradlew signInReport
  3. Use the appropriate SHA-1 key for both debug and release configurations.

Update build.gradle:
  • In android/build.gradle, add:

  • In android/app/build.gradle, add:

Configure Signing Configurations:
  1. Save the key.jks file inside the android/app/ directory of your Flutter project.

  2. Update android/app/build.gradle to include signing configurations: