I would like to read a user’s Google Spreadsheets from my example Vue app with auth0-spa-js authentication. To do this, I need a specific scope on my access token.
To start, on the Auth0 side, I went to Connections > Social and set up google-oauth2 login, provided my own Client ID and Client Secret, and added Spreadsheets permissions. Now upon login to my app, the Google oauth login process asks me to approve this new read/write Spreadsheet scope. So far so good.
According to Google documentation, the relevant scope URL is:
https://www.googleapis.com/auth/spreadsheets
Auth0 docs have an example of how to Pass Scopes to Authorize endpoint using curl. I tried to follow the same idea by adding the connection_scope
field in the options passed into Auth0Plugin (and thus, the authorize endpoint):
Vue.use(Auth0Plugin, {
domain,
clientId,
connection: 'google-oauth2',
connection_scope: 'https://www.googleapis.com/auth/spreadsheets',
...
After logging out/in, the token received from Auth0 does not include this scope, just the default ones (profile openid email
).
How can I request the Google Sheets scope in the token?