React-google-login: scope not working

Created on 9 Dec 2017  路  4Comments  路  Source: anthonyjgrove/react-google-login

Hi,

I think the 'scope' doesn't work, at least for me.

My code (the important bits):

import { GoogleLogin } from 'react-google-login';

                 <GoogleLogin
                        clientId="client_id"
                        buttonText="Login"
                        scope="https://www.googleapis.com/auth/youtube"
                        onSuccess={this.responseSuccess}
                        onFailure={this.responseFail
                  />

I also tried with 'https://www.googleapis.com/auth/youtube.readonly', 'youtube', 'youtube.readonly'. Every time, the scopes returned by getGrantedScopes() are:
https://www.googleapis.com/auth/userinfo.email https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/plus.me openid email profile

Can you please help me to figure out what am I doing wrong ?

Thanks 馃憤

All 4 comments

I am doing this and it works as expected.

scope='profile email https://www.googleapis.com/auth/youtube'

Hi !
I've a similar issue, but it's when I have more than one GoogleLogin component on the same page, but with different scope by GoogleLogin instantiation.

Apparently, the chosen scope is the first scope to be instanciate.

@anthonyjgrove
Hey, I am also facing the same issue. I have two buttons in my app and it is taking only first button property. It is refreshing only If I reload the page. Please give some solution for this.

Closing Due to Inactivity

Was this page helpful?
0 / 5 - 0 ratings