- 03 Nov 2022
- 4 Minutes to read
Google Authentication in Linux
- Updated on 03 Nov 2022
- 4 Minutes to read
When you connect to Google from Sisense, you can authenticate your account with your Google credentials if you are working from the localhost. If however, you are connecting remotely to the Sisense server, and the address of the Sisense Web Application is something other than localhost, Google requires that you connect using the OAuth 2.0 protocol. The OAuth 2.0 authorization framework enables a third-party, in this case, Sisense, to obtain limited access to an HTTP service such as Google Sheets.
To connect to Google Services through a remote Sisense server, you need to create a Google application to obtain OAuth 2.0 client credentials from Google and then add those credentials to a manifest file on your Sisense Server.
Google Authentication is not supported by the Sisense mobile application because Google applies a restriction on mobile applications using WebView components. For more information, see Modernizing OAuth interactions in Native Apps for Better Usability and Security.
Creating a Google Application
To create a Google application:
- Prepare a Linux Virtual Machine with internal domain access.
- Go to the Google API Console.
- Select an existing project or create a new one by selecting CREATE PROJECT.
If you are creating a new project, go to Step 4. If you select an existing project, go to Step 5.
- In the New Project area, define a project name and select a location. Click CREATE.
- The API Library opens. Click ← API Library on the top left to close it.
- In the sidebar under “APIs & Services”, select Credentials.
- If this is a new project, click CONFIGURE CONSENT SCREEN.
- In the OAuth consent screen, select the user type:
- Internal: only for users in your organization
- External: for any user with a Google account
- Click CREATE.
- In Authorized domains, enter the domains from where you will connect to the Google API, for example, yourcompanyname.com. Then click Save.Note:
If you are configuring remote access for SSL setup servers (https://), make sure that both the authorized domain and the callback url are configured with the https prefix.
- In the sidebar, click Credentials.
- Click + CREATE CREDENTIALS and select OAuth client ID.
- Under Application type, select Web application (more information here).
In the Name field, you can enter the name you will see in the console.
- The Authorized redirect URI is the path in your application that users are redirected to after they have authenticated with Google. The path will be appended with the authorization code for access. For example, for Google BigQuery it would be:
- Press Enter.Note:
- Must have a protocol
- Cannot contain URL fragments or relative paths
- Cannot be a public IP address
- The redirect URI must match the client side domain and be added to console APIs or you will get a redirect_uri_mismatch error.Note:
If you are configuring remote access for SSL setup servers (https://), make sure that both the authorized domain and the callback URL are configured with the https prefix.
For Sisense it should be in format:
'/oauth/R29vZ2xlIFNwcmVhZHNoZWV0cw==/callback'is a hardcoded immutable string.
If you are using a base URL, the format of the callback will be:
where base URL is 'https://APP_URL/reporting'. The origin for this base URL will be
The Google OAuth2.0 redirect URL doesn’t allow spaces, so Sisense has encoded the provider’s name (Google Spreadsheets) into the base64 format
– R29vZ2xlIFNwcmVhZHNoZWV0cw==. If you want to use another OAuth2.0 connector, you should add on this step redirect URL with appropriate base64 encoded provider name.
- Click Create. In the OAuth section, you will receive your client ID and secret.
- Copy the client ID and secret. You will need to add these credentials to the manifest file, as described in Manifest Configuration below.
- In the sidebar under “APIs & Services”, select Library.
Search for the relevant Google API, open it and click Enable (note that the first three are required if connecting to Google Sheets).
- Google Drive API
- Google Cloud Storage JSON API
- Google Sheets API
- Google Analytics Reporting API (this one is enabled by default, but it can be disabled if you have custom configuration in your project)
- Open the Sisense installation.
- Open the SSH connection to your Virtual Machine using IP.Note:
The manifest.json file can also be accessed via File Manager.
- Edit the manifest.json file for OAuth:
command cd /opt/sisense/storage/connectors/.
command ls -laand select the Google connector that you need.
cd <google_connector_folder_name>(for example, cd googleads).
- Open the manifest.json for editing using the Nano or Vim editors (nano
- In the manifest.json file, find the
OAuth2block. Add the clientId and clientSecret that you received when you created your Google app:
- Save the manifest.json file and close the editor (CTRL+S and CTRL+X in Nano).
Now you can open the Sisense web application using the domain name (http://www.domain.name:30845) and create a new ElastiCube with the configured source. For example: http://APP_URL/< your URL >.