-
Notifications
You must be signed in to change notification settings - Fork 0
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
More Auth Options #5
Comments
Hi, @vlucas ! Thank you for your feedback and for using Holysheets! I understand your concern regarding the limitation of authentication to JWT only. Your suggestion to pull out I will create a task to implement this feature. Your suggestion will help improve the package for everyone. Best regards |
Enhancement: Allow Custom Auth Instances for Google SheetsCurrent Behavior: Proposed Improvement: New Constructor Parameters:
Example Usage: const { google } = require('googleapis');
const Holysheets = require('holysheets');
const auth = new google.auth.OAuth2(
YOUR_CLIENT_ID,
YOUR_CLIENT_SECRET,
YOUR_REDIRECT_URL
);
// After obtaining the OAuth2 tokens
auth.setCredentials({
access_token: ACCESS_TOKEN,
refresh_token: REFRESH_TOKEN,
scope: SCOPES,
token_type: TOKEN_TYPE,
expiry_date: EXPIRY_DATE
});
const sheets = new Holysheets({
spreadsheetId: 'your-spreadsheet-id',
auth: auth
});
// Use the `sheets` instance as usual Benefits:
|
Yes, this is how it would look exactly! 👍 |
I am writing a Google Sheets Add-On, but I cannot use your awesome package because of how you have limited auth to JWT only. I use oAuth to do operations on my users behalf.
A better solution might be to pull the
google-auth-library
out of your package, make it apeerDependency
, and then let users pass in whatever auth instance they want to. All your package would need to accept in the constructor is aspreadsheetId
andauth
instance.The text was updated successfully, but these errors were encountered: