How to access the google scope to send email after user logs in with oauth?

@notbrent I’m trying to read, edit and send emails from the gmail.

So this code works for auth with google.

try {
const result = await Expo.Google.logInAsync({
androidClientId: ‘’,
iosClientId: ‘’,
scopes: [‘profile’, ‘email’],

      if (result.type === 'success') {
        console.log('128 -  google success ');

so i edited the scope to do so, like below.

scopes: [‘profile’, ‘email’, ‘’],

it doesnt give me any error message.

but i dont get the screen like this on the simuloator like it get on the web browser.

Question : Am i on right track ?

I thikn i should get this screen but i dont get it …

Basically im confused which path to go :


  1. when use use the google auth via the expo’s google auth on mobile, ( even after adding the scopes ) I dont get the screen where google asks user that this guy wants to access your emails. So i wonder if it works.

If that would work, id simply send the tokens to my backend and get it working.

But the nodemailer on the server side requies the client id to be web based i.e it requires the


1.2) would the tokens ( refreshToken) generated from the expo would work with node mailer ?

  1. Second option is to have user to signin from web and get the persmission to send emails. But this woudl require each user to do the 2 step whenver somebody new signup.

So nodemailer requeres few tokens

Heres the setup for nodemailer

let transporter = nodemailer.createTransport({
host: ‘’,
port: 465,
secure: true,
auth: {
type: ‘OAuth2’,
clientId: ‘’,
clientSecret: ‘2T_Achanced-kYQCK-xoAlb’

from: ‘’, // It has to be the email that user logged in with.
to: ‘’,
subject: ‘Message’,
text: ‘I hope this message gets through!’,
html: ‘Hi there, coming with the html’, // html body
auth: {
user: ‘’,
refreshToken: ‘1/vSlgpvWgQeBzeVWgLAMhjBz7LT4XzpGLMFa_h0jYigRAqoMDtRglva6nh7oLmYkv’,
accessToken: ‘ya29.GlCHANGEDq01l87lSQRshAerNUol2yV4xf2GTyfwWQG8SGkQSu-o1X4OF5k1zSWtQCHANGEDMYqL1hkxuwWc8NMDnZic9MnDzB96uByM’,
expires: 1484314697598

Question is : the Tokens passed from client side will play well with nodemailer ( backend ) ?

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.