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

Configure OAuth workflow #70

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Configure OAuth workflow #70

wants to merge 2 commits into from

Conversation

erxclau
Copy link
Member

@erxclau erxclau commented Apr 29, 2023

What's this PR do?

Adds Google OAuth support.

TODO:

  • Update README documentation...
  • Allow client (and token?) path configuration

Why are we doing this? How does it help us?

Closes #53

How should this be manually tested?

  • Create an OAuth client in Google Cloud Platform with readonly permissions for Google Drive. Ensure that the Google Drive API is enabled in the API Library. The OAuth client should have a Web application type, use http://localhost:3000 as the authorized JavaScript origin, and use http://localhost:3000/redirect as the redirect URI. Download the JSON client file and save it to ~./sink-google-auth-oauth-client.json. Currently, this is the only supported file location though we can allow the user to specify where they want to store their client configuration file.
  • If you choose to make the client external, it will be in a testing phase, meaning you need to manually add testing user emails that will be allowed to use the client. Theoretically, you can publish the client but that requires a more formal verification process on Google's end that doesn't seem worth the hassle. There is a 100 user limit in the testing phase.
  • Otherwise, if the client is internal, only users in your Google Cloud Platform organization will be able to use the client. I imagine a GCP organization costs money, or that university emails prohibit using GCP.
  • Create a project and install this branch with yarn add --dev michigandaily/sink#google-oauth.
  • Run yarn sink auth to generate a ~/.sink-google-auth-oauth-token.json file.
  • In your configuration, set your auth property to the above path to fetch with the OAuth token.

Are there any smells or added technical debt to note?

What are relevant issues or links?

Have you done the following, if applicable:

  • Performed a self-review of the code?
  • Linted code for good style and standards?
  • Added unit tests?
  • Tested manually on mobile?
  • Checked for performance implications?
  • Checked accessibility?
  • Checked for vulnerabilities with yarn audit --level=high?
  • Updated any documentation

@erxclau erxclau requested a review from naitian April 29, 2023 21:24
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

Successfully merging this pull request may close these issues.

Simplify authentication process
1 participant