Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
364 views
in Technique[技术] by (71.8m points)

Google OAuth consent screen asking for permissions not asked for?

I am dealing with an issue where the OAuth consent screen for my app is asking for scopes that I am not requesting.

I am using gapi js library and using gapi.auth2.init I am requesting just one scope:

gapi.load('auth2', () => {
  gapi.auth2.init({
    client_id: this.clientId,
    cookiepolicy: 'single_host_origin',
    fetch_basic_profile: false,
    scope: [
      'https://www.googleapis.com/auth/adwords'
    ].join(' ')
  });
  const googleButtons = this.elementRef.nativeElement.querySelectorAll(`#google-ads`);
  googleButtons.forEach(element => {
    this.attachSignin(element);
  });
});

public attachSignin(element) {
gapi.auth2.getAuthInstance().attachClickHandler(element, {},
  async (googleUser) => {
    let authResponse = await googleUser.grantOfflineAccess();
    this.googleCodeRetreived.emit(authResponse.code);
  }, (error) => {});
}

Also this matches the scope listed in my OAuth consent screens settings in my Google developers console.

enter image description here

This means that the user should only be asked to consent to providing adwords permissions. However my consent screen shows this:

enter image description here

I am wondering if anyone has run into this issue. Are these extra permissions required for Adwords to work? Also if it matters my app is for internal use only.

question from:https://stackoverflow.com/questions/65893578/google-oauth-consent-screen-asking-for-permissions-not-asked-for

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...