Skip to content

Instantly share code, notes, and snippets.

@juanchehin
Created November 13, 2023 16:25
Show Gist options
  • Save juanchehin/7982f8779908b97a07951babf1a03ca4 to your computer and use it in GitHub Desktop.
Save juanchehin/7982f8779908b97a07951babf1a03ca4 to your computer and use it in GitHub Desktop.
const oauth2Client = new OAuth2Client({
clientId: '1',
clientSecret: 'G',
redirectUri: "https://developers.google.com/oauthplayground",
});
const url = oauth2Client.generateAuthUrl({
access_type: 'offline',
scope: ['https://www.googleapis.com/auth/gmail.send'],
});
const code = '4/0'; // Copia el código de autorización obtenido después de la autorización.
// After acquiring an access_token, you may want to check on the audience, expiration,
// or original scopes requested. You can do that with the `getTokenInfo` method.
const tokenInfo = await oauth2Client.getTokenInfo(
oauth2Client.credentials.access_token
);
console.log(tokenInfo);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment