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

Can I use the library to access Google Spreadsheets of users who sign in with Google OAuth? #45

Open
tadasajon opened this issue Oct 11, 2021 · 1 comment

Comments

@tadasajon
Copy link

I have a situation in which users sign in to my app using their Google accounts. I then need to be able to read their Google Sheets. It is not clear to me whether this library would permit this, or whether this library only gives access to the Google Sheets of one account -- i.e., my Google account.

Thanks.

@Voronchuk
Copy link
Owner

Hi, the intended usage is with Google Service account. The main difference is that some registry logic is used to request and cache an authorization token. In your case, you should already have the valid token with the required permissions, which you should have been able to pass directly.

So if you don't have any other elixir library to achieve this goal, you can fork and modify functions like this:
https://github.com/Voronchuk/elixir_google_spreadsheets/blob/master/lib/elixir_google_spreadsheets/spreadsheet.ex#L560

Replace %{"Authorization" => "Bearer #{GSS.Registry.token()}"} with %{"Authorization" => "Bearer #{Keyword.fetch!(options, :auth_token)}"}

Or modify GSS.Registry.token() to return token scoped to specific user.

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