diff --git a/src/modules/google.js b/src/modules/google.js index 30f5aa26..68d3b5e4 100644 --- a/src/modules/google.js +++ b/src/modules/google.js @@ -11,8 +11,8 @@ // See: http://code.google.com/apis/accounts/docs/OAuth2UserAgent.html oauth: { version: 2, - auth: 'https://accounts.google.com/o/oauth2/auth', - grant: 'https://accounts.google.com/o/oauth2/token' + auth: 'https://accounts.google.com/o/oauth2/v2/auth', + grant: 'https://www.googleapis.com/oauth2/v4/token' }, // Authorization scopes @@ -41,6 +41,9 @@ // Let's set this to an offline access to return a refresh_token p.qs.access_type = 'offline'; } + else if (p.qs.response_type.indexOf('id_token') > -1) { + p.qs.nonce = parseInt(Math.random() * 1e12, 10).toString(36); + } // Reauthenticate // https://developers.google.com/identity/protocols/