This repository was archived by the owner on Sep 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Configuring Google OAuth
Mark Smith edited this page Oct 16, 2020
·
3 revisions
There are 3 Realm secrets that you need to obtain and configure when deploying the Google OAuth stuff:
Value Name | Type | Description |
---|---|---|
GOOGLE_ACCOUNT_ID |
Plain text | This points to the account you wish to query, such as MongoDB. MongoDB's account ID is 'UCK_m2976Yvbx-TyDLw7n1WA', which was obtained here |
GOOGLE_CLIENT_ID |
Secret | Obtained from https://console.developers.google.com/apis/credentials by setting up a new application, and then adding an OAuth Client ID. Select "Web application", and add the webhook's URL as the "Authorized redirect URI" |
GOOGLE_CLIENT_SECRET |
Secret | See GOOGLE_CLIENT_ID |
The webhook can be used to call YouTube API endpoints, as demonstrated at the end of the function code, but it hasn't been generalised yet. This has two stages:
- Need a function within DREAM to check if appropriate auth is stored in the database, with a URL to redirect to if it isn't.
- The user should be redirected to the implemented endpoint with an ID to authenticate/authorize against. This step may involve them approving the app's access to their Google account. The auth information should be inserted into a collection, and then the user is redirected back to a page within DREAM. Now the appropriate auth will be available to the Realm app.
- This webhook should be configured by documents in a collection, instead of Realm Values & Secrets. That means we can authenticate & authorize many users across a bunch of platforms.
None of this is actually too hard with MongoDb (I ❤️ MongoDB), it just needs to be thought through and implemented.