android – Google Signal-In Failed with “Entry blocked: Authorization error, Error: Invalid_scope” in Flutter

0
2
android – Google Signal-In Failed with “Entry blocked: Authorization error, Error: Invalid_scope” in Flutter


I am getting an “Entry blocked: Authorization error, Error: Invalid_scope” error when attempting to implement Google Signal-In in my Flutter utility with a number of OAuth scopes.

Error Message

Entry blocked: Authorization error, Error: Invalid_scope

My Setup

Flutter Model: [Your Flutter version]
google_sign_in package deal: [Your package version]
Platform: Android
Goal: Google Calendar, and fundamental profile entry

OAuth Request Particulars
My OAuth request consists of the next parameters:

login_hint=ak**********@gmail.com  
hl=en-IN  
response_type=consent_proof  
android_options=CAMQAQ  
color_scheme=darkish  
client_id=*200-m552****************n15f59*p7****kr*u.apps.googleusercontent.com  
include_granted_scopes=true  
scope=https://www.googleapis.com/auth/userinfo.e-mail   https://www.googleapis.com/auth/calendar https://www.googleapis.com/auth/hold openid   https://www.googleapis.com/auth/userinfo.profile  
flowName=GeneralOAuthFlow

Google Cloud Console Configuration
✅ Created OAuth 2.0 Shopper ID for Android
✅ Added appropriate package deal identify and SHA-1 fingerprint
✅ Enabled Google Calendar API
✅ Enabled Google Maintain API (if accessible)
✅ Added check customers to OAuth consent display screen

Code Implementation

import 'package deal:google_sign_in/google_sign_in.dart';

class GoogleSignInService {
  static remaining GoogleSignIn _googleSignIn = GoogleSignIn(
    scopes: [
      'email',
      'profile',
      'openid',
      'https://www.googleapis.com/auth/calendar',
      'https://www.googleapis.com/auth/keep',
    ],
  );

  static Future signIn() async {
    attempt {
      remaining GoogleSignInAccount? account = await _googleSignIn.signIn();
      return account;
    } catch (error) {
      print('Google Signal-In Error: $error');
      return null;
    }
  }
}

LEAVE A REPLY

Please enter your comment!
Please enter your name here