Skip to content

Google Workspace

BlokSec enables passwordless login to Google Workspace and also supports automatic user provisioning via the Google Directory API. This guide covers both the authentication setup (SAML) and optional provisioning configuration.

  • A BlokSec admin account with permission to create applications
  • A Google Workspace account with Super Administrator access
  • A Google Cloud project (required for provisioning only)

1. Create the Google Workspace application in BlokSec

Section titled “1. Create the Google Workspace application in BlokSec”
  1. Sign in to the BlokSec admin console as a user with admin privileges
  2. From the dashboard, click + Add Application and select Create From Template
  3. Select the Google Workspace template
  4. Complete the application details with the following values, replacing <your_domain> with your Google Workspace domain (for example, acme.com):
FieldValue
NameGoogle Workspace (or your preferred name)
Entity IDhttps://www.google.com/a/<your_domain>/acs
NameID SourceAccount name
Assertion Consumer Servicehttps://www.google.com/a/<your_domain>/acs
Name ID FormatEmailAddress
  1. Click Submit to save the configuration
  2. Click View Cert and copy the certificate — save it to a file (for example, BlokSecGoogleCert.pem)
  3. Note the SSO URI — you will need it in the next step

2. Configure SSO in the Google Workspace admin console

Section titled “2. Configure SSO in the Google Workspace admin console”
  1. Sign in to the Google Workspace admin console as a Super Administrator
  2. Navigate to SecurityAuthenticationSSO with third-party IdP
  3. Click Add SSO profile and enter the following values:
FieldValue
Sign-in page URLSSO URI from BlokSec (noted in step 7 above)
Sign-out page URLhttps://mail.google.com/a/<your_domain>
Verification certificateUpload BlokSecGoogleCert.pem from step 6 above
  1. Click Save
  1. Open a private/incognito browser window
  2. Navigate to https://mail.google.com/a/<your_domain>
  3. Approve the sign-in on the BlokSec mobile app
  4. Confirm you are successfully signed in to Google Workspace

Provisioning allows BlokSec to automatically create Google Workspace user accounts when a new user is registered in BlokSec, eliminating the need to create accounts in both systems separately.

1. Create OAuth 2.0 credentials in Google Cloud

Section titled “1. Create OAuth 2.0 credentials in Google Cloud”
  1. Sign in to the Google Cloud Console and open your project
  2. Navigate to APIs & ServicesCredentials
  3. Click Create Credentials and select OAuth 2.0 Client ID
  4. Choose Web application as the application type
  5. Under Authorized JavaScript origins, add: https://api.bloksec.io
  6. Under Authorized redirect URIs, add: https://api.bloksec.io/oauth2callback
  7. Click Create, then download the generated JSON credentials file

BlokSec requires a long-lived refresh token to make authenticated calls to the Google Directory API on behalf of your domain.

  1. Go to Google OAuth 2.0 Playground
  2. Click the gear icon (Settings) and check Use your own OAuth credentials
  3. Enter the Client ID and Client Secret from the JSON file downloaded above
  4. In the scope list, authorize: https://www.googleapis.com/auth/admin.directory.user
  5. Click Authorize APIs and complete the sign-in with your Super Administrator account
  6. Click Exchange authorization code for tokens
  7. Copy the Refresh token from the response
  1. In the BlokSec admin console, open the Google Workspace application and click the gear iconEdit Application
  2. Navigate to the Provisioning tab
  3. Enable provisioning and set the integration type to Google Directory API
  4. Open the JSON credentials file downloaded from Google Cloud and add the refresh token as a new field:
{
"client_id": "YOUR_CLIENT_ID",
"client_secret": "YOUR_CLIENT_SECRET",
"refresh_token": "PASTE_REFRESH_TOKEN_HERE",
...
}
  1. Paste the complete JSON (with the refresh_token field added) into the provisioning credentials field
  2. Click Submit to save