Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DEV] Investigate Standardized Google Client #25

Open
DConnorFong opened this issue Nov 2, 2020 · 1 comment
Open

[DEV] Investigate Standardized Google Client #25

DConnorFong opened this issue Nov 2, 2020 · 1 comment
Assignees

Comments

@DConnorFong
Copy link
Collaborator

Development Task 🔧

What? ❓

Here are some ways we are opening different clients for our Google integrations

const client = new google.auth.JWT(keys.client_email, null, keys.private_key, [
    'https://www.googleapis.com/auth/spreadsheets',
]);

and

const oauth2Client = new google.auth.OAuth2(keys.client_id, keys.client_secret, keys.redirect_uris[0]);

Particularily OAuth2 vs JWT

Could you dig around the Google API docs and see if this makes a difference for different integrations (google.mail, google.sheets)? If not I would probably like to work towards building a client factory that just makes all of these in one place.

@DConnorFong
Copy link
Collaborator Author

It actually looks like you can use OAuth2 for everything, and JWT for a subset of those things (with the benefit of performance avoiding an extra API call)

https://developers.google.com/identity/protocols/oauth2/service-account

For performance reasons may make sense to generate both of them, but simplicity to just generate an OAuth2 for everything.

@DConnorFong DConnorFong assigned DConnorFong and unassigned ABZhang0 Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants