Google validation issues

Hello,

I am currently passing Google verification for my app, and i am trying to understand what is going wrong currently. From google mail: “The scopes listed on your OAuth consent screen are different from the scopes requested in your Cloud Console submission.”

Here is one image with my nylas configuration, google app console configuration (scopes are aligned) and actual google oauth consent page (not aligned to scopes, url generated with auth.urlForOAuth2)

Just to make things clear - the scopes you see on Google OAuth consent page are those that i had before (gmail.modify and gmail.compose), but i removed them from both nylas and google console by Google demand as it was ‘too broad’ which is true for my app.

Clearly something on Nylas side still sends old scopes during the oauth exchange and for me this potentially creates issues with Google validation.

So for now i am stuck.

Any advice fellow developers? :slight_smile:

Hello,

Are you passing any scopes in the generated URL? If no scopes are provided, we will default to using the connector scopes.

Documentation:
https://developer.nylas.com/docs/api/v3/admin/?redirect=api#tag/authentication-apis/get/v3/connect/auth

Let us know if you have any questions.

Many thanks,
Samuel R.
Support Engineer, Nylas

Hello Samuel, no, i am not passing anything, the code is rather straightforward:

/**
   * Generate the URL for the Nylas OAuth flow
   *
   * Pure SDK operation - no business logic.
   *
   * @param state - State object containing tenant information
   * @param provider - The email provider (e.g., 'google', 'microsoft')
   * @returns OAuth URL to redirect user to
   */
  getOauthUrl(state: string, provider: Provider): string {
    const redirectUri = getApiFullUrl() + '/nylas/code'

    const options = {
      redirectUri,
      clientId: this.config.get('NYLAS_CLIENT_ID'),
      provider,
      state,
    }

    try {
      const oauthUrl = this.nylasClient.auth.urlForOAuth2(options)

      return oauthUrl
    } catch (e) {
      throw new Error(`Error generating nylas oauth url: ${e.message || e}`)
    }
  }

I was thinking the same, if i am not adding anything then Nylas will use the one configured. Maybe there is an error in SDK ?

Hello. Our Support team has reached out to you via email to continue this investigation. Please check your mailbox for our message.