Google Drive
Element Web can integrate with Google Drive so that users can browse their files and share them into rooms.
The integration is provided by the Client Integrations component of ESS Pro (ESS Pro 26.12.0 or later). Client Integrations is a service that links each user's Matrix account to their Google account and talks to Google Drive on their behalf. When it is enabled, ESS Pro configures Element Web to use it automatically.
Requirements
- A Google Cloud project with the Google Drive API enabled.
- An OAuth 2.0 client registered in that project (see below).
Registering an OAuth 2.0 client in Google Cloud
Client Integrations signs users in to Google with OAuth 2.0.
- In the Google Cloud Console, select or create the project to use and enable the Google Drive API.
- If the project does not have one yet, configure the OAuth consent screen.
The app name is shown to users when they link their account, so pick something like
Element. - Under APIs & Services > Credentials,
create an OAuth client ID:
- The application type must be Web application.
- Add
https://<client integrations hostname>/api/v1/googledrive/callbackas an Authorized redirect URI.
- Note the Client ID and Client secret that Google generates.
Configuring ESS Pro
See how to download example files from the helm chart here.
Client Integrations is disabled by default. Enable it, and enable Google Drive file sharing, with:
clientIntegrations:
enabled: true
ingress:
host: <client integrations hostname>
google:
files: true
clientId: <client ID from Google Cloud>
clientSecret:
value: <client secret from Google Cloud>
The Google client secret can be provided inline in the values with value, as above, or from an existing Secret
in the same namespace with secret and secretKey. See Handling secrets in ESS Pro.
Google Drive can be enabled alongside other Client Integrations services, such as Nextcloud.
Other settings can be seen under the clientIntegrations section of the
chart values.
Usage
Users click the attachments button in any room and choose Google Drive. The first time, they are asked to sign in to Google and allow access. The link is stored against their Matrix account, so they only need to do this once rather than on each device.
