GoogleUser.getAuthResponse() doesn't contain access_token

前端 未结 2 1027
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-01-01 13:35

UPDATE2: I revisited this issue and have solved the problem by carefully following the doco linked below. But first, for those who are struggling with this,

2条回答
  •  自闭症患者
    2021-01-01 14:31

    Figured out the fix for this. Turns out that if we don't provide the login scope config in gapi.auth2.init it doesn't return access_token in getAuthResponse. Please call gapi.auth2.init as given below and access_token will be present.

    gapi.auth2.init({
      client_id: ,
      'scope': 'https://www.googleapis.com/auth/plus.login'
    })

提交回复
热议问题