Created
November 13, 2023 16:25
-
-
Save juanchehin/7982f8779908b97a07951babf1a03ca4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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