Google is an identity-provider option for Process Focus. For the shared registration behaviour, see Single-Sign-On (SSO).
Google Workspace
Section titled “Google Workspace”Setting up a Google Workspace identity provider requires injecting two
secrets. We recommend you use the
configureOrg method to do that, as this will provide proper error
feedback when configuration is missing.
Export configureOrg as an Effect to load the required configuration. When
the runtime executes it, a missing value fails configuration with an error
identifying the missing key.
See Configuration for how Config,
yield*, and configureOrg work together.
import { AuthenticationConfig } from "@pf/auth-config"import { Organisation } from "@pf/process"import { Config, Effect } from "effect"
export const org = new Organisation({ name: "My organisation" })
export const configureOrg = Effect.gen(function* () { const googleClientId = yield* Config.String("GOOGLE_CLIENT_ID") const googleClientSecret = yield* Config.String("GOOGLE_CLIENT_SECRET")
new AuthenticationConfig(org, "auth", { identityProviders: { google: { clientID: googleClientId, clientSecret: googleClientSecret, scopes: ["openid", "email", "profile"], }, }, })
return org})You need two pieces of configuration here:
- Client ID.
- Client secret.
Google doesn’t make creating these values easy. Detailed steps are in the next section.
This configuration does not allow anyone to log in yet, unless they have an invitation.
Organisational Units
Section titled “Organisational Units”If you use organisational units in your Google Directory, it’s possible to use them as well. For example, you could surface the organisational unit as the role. That makes Process Focus seamless: a new user logs in and is immediately assigned the right role based on the organisational unit they are in.
The role construct IDs must match the Google organisational unit paths.
For example, a role with ID Office Staff directly under the organisation
has the path /Office Staff.
import { AuthenticationConfig } from "@pf/auth-config"import { Organisation, Role } from "@pf/process"import { Config, Effect } from "effect"
export const org = new Organisation({ name: "My organisation" })
export const officeStaff = new Role(org, "Office Staff")export const supportStaff = new Role(org, "Support Staff")export const management = new Role(org, "Management")
export const configureOrg = Effect.gen(function* () { const googleClientId = yield* Config.String("GOOGLE_CLIENT_ID") const googleClientSecret = yield* Config.String("GOOGLE_CLIENT_SECRET") const googleServiceAccountKey = yield* Config.String("GOOGLE_SERVICE_ACCOUNT_KEY") const googleAdminEmail = yield* Config.String("GOOGLE_ADMIN_EMAIL")
new AuthenticationConfig(org, "auth", { identityProviders: { google: { clientID: googleClientId, clientSecret: googleClientSecret, scopes: ["openid", "email", "profile"], invitedOrgUnits: [ "/Office Staff", "/Support Staff", "/Management", ], orgUnitAsRole: true, serviceAccountKey: googleServiceAccountKey, adminEmail: googleAdminEmail, }, }, })
return org})Configure Google Directory access
Section titled “Configure Google Directory access”The OAuth client signs users in. Process Focus uses a separate service account to look up their organisational unit in Google Directory.
- In Google Cloud, enable the Admin SDK API in the project that owns the service account. Create a service account and download a JSON key for it.
- In the Google Admin console, have a Workspace super administrator
set up domain-wide delegation
for the service account’s numeric client ID. Grant it only
https://www.googleapis.com/auth/admin.directory.user.readonly. Leave the sign-inscopesin the example unchanged. - In your Process Focus environment, set
GOOGLE_SERVICE_ACCOUNT_KEYto the Base64-encoded contents of the downloaded JSON key and store it as a secret. SetGOOGLE_ADMIN_EMAILto the email address of a Workspace administrator who can read the relevant users in Directory. Process Focus makes the lookup on behalf of that administrator.
List the exact Google organisational unit paths in invitedOrgUnits.
Set orgUnitAsRole: true if you also want to assign matching Process
Focus roles on first sign-in.
Seamless invitations
Section titled “Seamless invitations”In the example above, invitedOrgUnits acts as an invitation for anyone
whose Google Workspace organisational unit exactly matches a listed path.
On their first Google sign-in, Process Focus checks their unit in Google
Directory. Someone in /Office Staff can sign in to the Dashboard
without a separate invitation or registration link. With orgUnitAsRole
enabled, they also receive the matching Office Staff role unless an
explicit invitation supplies their roles.
Listing /Office Staff does not invite members of its child units. Add
each child path separately or create an individual
invitation.
Allowing access to Gmail accounts
Section titled “Allowing access to Gmail accounts”You can still use Google for SSO even if you don’t use Google Directory. Create an OAuth token as per the next section, and select External for Audience when creating the app in your project.
Creating a Google OAuth token
Section titled “Creating a Google OAuth token”The steps below summarise the process; Google’s console changes often:
-
Log in to the Google Console.
-
Create a project: it’s best to create a new project for every new app or project.
-
Select that project.
-
Go to the credentials page. For a new project (which you should have created), you will need to start creating an app, so click “Get started”:

-
Create an app by providing a name. Note you can have only one app per project.
-
Then, for Audience, select Internal if you rely on your Google Workspace Directory, or External if you want to use Google purely as social login. For external apps, you can add a list of Gmail addresses which should have access.
-
Follow the instructions, or go to the Clients page to create an OAuth client.

-
Click Create credentials and select OAuth client ID:

-
For Application type, select “Web application”. For Authorised redirect URIs supply a list of callbacks, for example for local testing, a localhost and port. You can also pass in URLs created when deploying via the Process Focus Cloud Console, or if you use custom domains, those as well.

Then press Create (or Save when editing).
-
Click Download JSON to store the credentials locally, and your agent will then know how to use this to configure your SSO in Process Focus:
