How Mattermost single sign-on with Google Workspace works
A team running self-hosted Mattermost that wants staff to sign in with their Google Workspace accounts should know up front that Google sign-in uses OpenID Connect through Mattermost's OpenID Connect settings, not SAML. Mattermost treats Google as an OpenID Connect identity provider. You register an OAuth client in Google Cloud, give Mattermost its client ID and secret, and point it at Google's discovery endpoint so it can read the provider's configuration. The integration covers four things: the OAuth client and its redirect URI, which must match your Mattermost site URL exactly and be served over TLS; the discovery endpoint, which Mattermost prepopulates from the issuer; the People API, which Google requires to be enabled in the project so Mattermost can read basic profile details; and the sign-in and first-login account creation flow that follows.
The integration does not cover ongoing profile sync, so a name or email change made in Google Workspace will not flow into Mattermost on its own. It also does not deprovision accounts. A user suspended or deleted in Google can still hold an active Mattermost session until that session expires or an administrator deactivates the account, so offboarding needs its own process. Multi-factor authentication is not enforced by this path either. Google may prompt for a second factor during sign-in, but Mattermost's own MFA enforcement settings govern only email and LDAP accounts, so a Google-only policy has to be set in Google. Confirm each of these limits against the current Mattermost documentation at build time, since attribute handling and session behavior change between server releases.
SSO is included from the Professional plan according to the Mattermost pricing page, so the licensing question is usually settled before the Google-specific work begins. Confirm the exact Google Cloud console steps, consent screen settings and People API requirements against current Google documentation and the Mattermost OpenID Connect guidance when you build, because Google changes its console and OAuth screens without notice. Decide early whether you will allow only accounts in your own Workspace domain and how you will handle personal Google accounts that users may try to use.
What you need before you configure Google sign-in
Google sign-in for Mattermost depends on several decisions made before anyone opens the System Console. The items below cover the Mattermost side, the public address the redirect depends on, and the Google Cloud and Workspace permissions that have to line up.
A supported Mattermost server version
Confirm your server is on a release that still receives support. The server releases page lists v11.7 as an Extended Support Release, supported until 2027-05-15, and it lists monthly releases with their own end dates. Check the page on the day you plan the change, because a version nearing end of support may need an upgrade before the Google configuration makes sense.
Server releases pageA plan that includes OpenID Connect
SSO over SAML, OIDC and OAuth is listed from the Professional plan on Mattermost's pricing page, so the subscription level is the first gate. Ask your Mattermost account contact to confirm in writing that your license covers OpenID Connect for your deployment. Pricing is not published, so the license terms, not the pricing page, decide what you can enable.
A public HTTPS site URL
The Google redirect comes back to a path on your Mattermost site URL, and that path requires TLS. Confirm the public hostname, certificate and reverse proxy routing before you create the OAuth client, because Google asks for the exact redirect URI and a later hostname change means editing the client again. Internal-only hostnames will not work for a Google sign-in flow.
A Google Cloud project and OAuth client
Create or choose a Google Cloud project that your organization controls, not one owned by a contractor or an individual. The OAuth client, its consent screen settings and the client ID and secret all live in that project. Record the project owner and the account that created the client so that changes and audits can be traced back to someone accountable.
Workspace approval from an admin
A Google Workspace super admin, or an admin you have delegated the right to approve third-party apps, has to permit the OAuth app for your domain. Confirm who holds that role before you start. Also check whether your domain already restricts third-party OAuth apps, since an admin policy can block sign-in even when the Mattermost and Google Cloud settings are correct.
People API enabled in the same project
Mattermost reads profile details through the Google People API, so it must be enabled in the same Google Cloud project as the OAuth client. Enabling it in a different project leaves the client unable to retrieve the attributes Mattermost expects. Also name one owner for the client secret, record its expiry date, and plan how it will be rotated before it lapses.
How a Google sign-in reaches Mattermost
The sign-in starts in the user's browser, which opens the Mattermost login page through the organization's reverse proxy. Mattermost reads the discovery document to find Google's endpoints, then the browser is sent to Google's authorization endpoint. Google returns an authorization code to the Mattermost redirect URI, and the server exchanges that code for tokens with the client_id and client_secret. Check that the redirect URI matches exactly, that the proxy passes the callback through over TLS, and that the identity claims and profile data arrive before the local account is created or matched.
Trust boundaries and hand-offs in a Google OpenID Connect sign-in.
Configuration sequence for Google OpenID Connect
This sequence takes a Google Workspace tenant from a blank Google Cloud project to a tested Mattermost sign-in flow over OpenID Connect. Each step closes with a check, so a failure is caught at the step that caused it rather than during the pilot.
Create or select the Google Cloud project
A Google Workspace administrator or a cloud engineer with project rights selects an existing Google Cloud project owned by the organization or creates a new one dedicated to identity. In the API library, they enable the People API, which Mattermost relies on when it reads profile data during Google sign-in. Keep the project owned by the organization's own accounts, not by an individual. The step is done when the People API shows as enabled in the project's API dashboard and the project is listed under the organization in the console.
Configure the OAuth consent screen
In the Google Auth Platform, the project owner sets the app name, support contact and the audience for the consent screen. Where Google offers the internal user type for the Workspace organization, choose it so that only accounts in the organization's domain can authenticate. Where that option is not available for the tenant, confirm with your Google Workspace administrator how domain restriction will be enforced before the pilot. The step is done when the consent screen is saved and a test sign-in from an account outside the domain is refused.
Create the web OAuth client and redirect URI
Create an OAuth client ID of the web application type. Register the redirect URI exactly as Mattermost constructs it from the public site URL configured in the System Console, using HTTPS and the same host name users type into their browsers. A mismatch in scheme, host or path is the most common cause of a failed callback, so copy the value from the Mattermost documentation for your version rather than typing it from memory. The step is done when Google lists the redirect URI under the client's authorized redirect URIs with no trailing differences from the site URL.
Store the client ID and secret
Record the client ID and client secret in the organization's approved secrets store, with an owner, a rotation date and access limited to the people who administer Mattermost. Do not paste the secret into tickets, chat channels or configuration files committed to source control. Confirm with your security team how the secret will be rotated and who is notified when Google issues a new one. The step is done when the secret can be retrieved by the administrator who will enter it and the store's access log shows the item was created.
Enter the OpenID Connect settings in the System Console
In the Mattermost System Console, open the Google sign-in settings under authentication and enter the client ID and secret. Use the prepopulated Google discovery endpoint option so the server loads Google's published configuration rather than endpoints typed by hand. Confirm that the server can reach Google's discovery document from its network, including any egress proxy rules. Save the configuration and reload the page. The step is done when the discovery endpoint loads without an error and the sign-in button for Google appears on the login page.
Set sign-in and account behavior
Decide whether Google sign-in is the only method or sits alongside email login during the pilot, and whether accounts are created on first sign-in or must already exist. Review which profile fields Mattermost takes from Google and which it updates on later sign-ins. Attributes managed in Google, such as name and email, may not sync back to Mattermost in the direction administrators expect, so confirm the behavior in the current documentation with a test account before rollout. Record the decisions in the change record. The step is done when the settings match the written decision and the team has signed off on the behavior.
Test with a pilot group in each organizational unit
Select test accounts from each Google Workspace organizational unit that will use Mattermost, including one outside the intended domain as a negative test. Each pilot user signs in through Google and the redirect should return to the Mattermost server without a TLS or certificate error. Check that each new account has the expected email address and username, and that a user from an excluded unit is refused. Log the results and fix any mismatch before extending access. The step is done when every pilot account has the expected result and the test log is signed off by the administrator and a security reviewer.
Which identity fields Mattermost takes from Google
This table maps each identity field Mattermost reads from a Google sign-in to its owner, whether it refreshes at each sign-in, and the check to run before go-live. Read it as a list of values you can trust for login and identity, and values that Google or the Mattermost administrator must maintain. Confirm exact claim names against the Mattermost OpenID Connect documentation for your installed version.
| Field | Value owner | Updates at each sign-in | Check to run |
|---|---|---|---|
| Email (login identifier) | Google account holder, managed in Google Workspace | Typically yes, confirm for your version | Sign in with a test user and confirm the account matches the Workspace email |
| Subject claim (stable identifier) | Google, assigned per account | No, it does not change for the account | Confirm the stored identifier survives a password reset and a name change |
| Preferred username or derived username | Mattermost administrator (derived from email if unset) | Depends on the setting, confirm in your version | Check for username collisions across users with similar email prefixes |
| First name and last name | Google Workspace profile, edited by the Workspace admin | Confirm whether Mattermost overwrites local edits | Change a name in Google and sign in again to see what Mattermost displays |
| Profile fields via the People API | Google Workspace directory data | Depends on scope and configuration | Confirm the People API is enabled and the requested scopes match the documentation |
| Nickname, position and other profile attributes | Mattermost users or administrators, unless set by the identity provider | Usually no once edited locally, confirm for your version | Decide which fields users may edit in Mattermost and document the rule |
| Admin or guest role | Mattermost system console, not Google | No, role changes stay within Mattermost | Verify that a Google sign-in does not change role assignments |
Which attributes stay out of sync after the first sign-in
Plan for profile attributes that are set once and then drift. When a user signs in to Mattermost with Google Workspace, the account takes its name, email address and other profile values at first sign-in. Later changes made in Google, such as a renamed user, a new job title, a new manager or a suspended account, are not pushed into Mattermost. Google does not send these changes to Mattermost, so the Mattermost profile can show a name or title that no longer matches the directory. Before go-live, confirm with your own Google Workspace and Mattermost test accounts which fields are populated at first login and which ones you will need to correct by hand. Do not assume that a value changed in Google will appear in Mattermost on the next sign-in.
The bigger risk is a suspended or deleted Google account that stays active in Mattermost. Suspending a user in Google Workspace blocks new Google sign-ins, but it does not automatically deactivate the Mattermost user unless a separate control is in place. An existing session or a remaining client token may keep working until it expires, and the account stays listed as active. Decide before go-live which of three approaches you will use: an administrator-managed deactivation step through the System Console or the API, a scheduled review that compares active Mattermost accounts with the Workspace directory, or a directory sync source that deactivates leavers on your behalf. Each option has different owners and different evidence trails, so write the chosen process into your runbook and test it with a disabled test account. The Mattermost user provisioning and deprovisioning guide covers account removal in detail.
Security controls for Google sign-in to Mattermost
Google sign-in moves the front door of your Mattermost server to an identity provider you do not run, so the controls around it matter as much as the OAuth setup. The cards below cover secrets, consent, transport, administrative access, the fallback login path and MFA ownership, which together decide who can sign in and how.
Keep the client secret out of config files
The Google OAuth client secret gives anyone who holds it the ability to impersonate your OAuth client, so it should live in a secret store or environment injection rather than in the server configuration file that gets copied into backups and tickets. Set a rotation schedule before go-live, record who owns it, and plan the rotation as a change window, because saving a new secret in the System Console takes effect for the next sign-in attempts. Confirm with your platform team where secrets are injected in your environment.
Restrict the consent screen to your domain
Configure the OAuth consent screen as internal to your Google Workspace organization where your Google setup allows it, so that only accounts in your domain can complete sign-in. Review the audience and publishing status in the Google Cloud console after any change, because an external or test audience can admit accounts you did not intend to onboard. Also confirm who in your organization can create or edit OAuth clients in the Google project.
Require TLS on the site and proxy
Mattermost's Google redirect URI must use HTTPS, and the Site URL, the reverse proxy and any load balancer in front of the server should all terminate TLS with certificates your team manages. Check that the proxy does not expose the server over plain HTTP on an alternate port and that forwarded headers are set correctly so the server builds the expected redirect URI. Confirm the certificate chain and renewal owner before testing sign-in.
Limit who changes SSO settings
Anyone with System Console access who can edit the Google sign-in settings can redirect logins, change the client they trust, or turn sign-in on or off for the whole server. Limit system admin rights to a named group, review that group on a fixed cadence, and log changes to authentication settings where your audit tooling can see them. Ask your Mattermost administrators which accounts currently hold system admin rights before you enable the integration.
Decide the email and password path
Decide whether users may still sign in with an email and password once Google sign-in is enabled. Keeping the password path enabled preserves a recovery route when Google is unavailable, but it also gives attackers a second sign-in surface that bypasses the identity provider's controls. Record the decision, the accounts that may use the fallback, and the procedure for re-enabling it, and confirm that the choice matches your organization's standard for workforce sign-in.
Set a reviewed MFA position
Google account MFA is configured in Google, so Google sign-in inherits whatever second factor your Workspace policy requires, while Mattermost's own TOTP enforcement applies to email accounts and does not cover Google-authenticated users. Write down which factors Google enforces, who can exempt accounts, and how this position will be reviewed. Google sign-in does not replace device and session policies, so set session lifetime, device management and sign-out behavior separately and review them with your identity team.
Common Google sign-in failures and how to fix them
This table pairs each Google sign-in symptom with its likely cause and the first check or fix. Work down the rows in order when a login fails, because several symptoms share a root cause such as a mismatched redirect URI or an unreachable discovery endpoint. Confirm exact setting names and console paths against the Mattermost SSO documentation for your server version.
| Symptom | Likely cause | Check or fix |
|---|---|---|
| Google returns a redirect URI mismatch error | The authorized redirect URI in the Google OAuth client does not match the Mattermost site URL exactly, including scheme, host and path | Confirm the Site URL in the System Console, then make the Google client redirect URI match it character for character, including the /signup/google/complete path |
| Sign-in fails before reaching Google or returns a TLS-related error | The Mattermost site URL is served over plain HTTP, and Google OAuth redirects require HTTPS | Put Mattermost behind TLS, update the Site URL to the https address, and retest from a clean browser session |
| Login completes with Google but the account lookup or profile step fails | The Google People API is not enabled for the Google Cloud project that holds the OAuth client | Enable the People API for the same project, then wait for propagation and retry with a new sign-in attempt |
| Login fails with a People API permission or quota error | The project has an API restriction or policy that blocks the People API, or the API key scope excludes it | Review API restrictions on the project and allow the People API for the OAuth client, then confirm the API appears under enabled APIs |
| Mattermost cannot load the Google sign-in configuration | The discovery endpoint for Google OpenID Connect is blocked by a proxy, firewall or DNS rule on the Mattermost server | Test outbound HTTPS from the Mattermost node to the Google discovery URL, then allow it or configure the server proxy settings |
| Users see an access blocked message from Google | Google Workspace admin policy restricts third-party or unverified OAuth apps for the domain | Ask the Workspace admin to review app access control for the OAuth client ID and approve it for the organizational units that need sign-in |
| A user outside the permitted domain is rejected | Domain restriction in Mattermost or the OAuth consent configuration excludes accounts whose email domain is not allowed | Confirm the allowed domain settings and the consent screen audience, then verify the user's primary Google account email matches the allowed domain |
| A returning user sees a new account or a conflict on sign-in | An existing email login account with the same address was not linked, so Google sign-in created a second account | Check for duplicate accounts by email, plan the account merge or migration with the auth-switch procedure, and tell users to sign in with the original method first |
| Sign-in worked before but now fails with an invalid client error | The Google client secret was rotated or regenerated, and Mattermost still holds the old value | Create or copy the current secret in Google Cloud, paste it into the Google SSO settings in the System Console, save, and retest |
Questions teams ask before setting up Google sign-in
Can our team configure Google OpenID Connect for Mattermost ourselves?
Yes, if your team has administrator access to Google Cloud, Google Workspace and the Mattermost System Console. The work spans three places: a Google Cloud OAuth client with the exact redirect URI, the People API enabled for the project, and the Mattermost OpenID Connect settings using the discovery endpoint. The skills needed are OAuth and OIDC basics, DNS and TLS for the Mattermost site URL, Mattermost administration, and enough Workspace administration to approve the consent screen and the user type. Most failures trace to a redirect URI that does not match the site URL exactly or to profile fields that Google does not return. Confirm the current Google steps against Google's own documentation when you start, because console screens change.
What drives the cost of a Google Workspace sign-in setup?
Mattermost does not publish prices. Its pricing page says SSO, including OpenID Connect, is included from the Professional plan, so the licence is a separate subscription paid to Mattermost, while implementation labor is paid to whoever does the work. Implementation cost follows the written scope: the number of Google Cloud projects and Workspace domains, the proxy and TLS setup, how many existing accounts must be matched, the plan level, and how much testing you require. The setup is one-time work, while the subscription, secret rotation and retesting after server upgrades recur. Ask any quote to list each item, the testing scope, and who owns each step.
How long does Google sign-in take to set up?
The duration depends on your environment and on approvals, and no reliable figure applies across organizations. The largest variables are how quickly a Google Workspace administrator approves the OAuth client, how long DNS and certificate changes take in your change process, whether a test group already exists, and whether existing accounts need to be matched. Ask for a scoped timeline that lists each dependency, names the person who approves each one, and separates the build from the pilot and cutover. A timeline without named approvers usually slips at the approval step.
What do we need to provide for a Google sign-in engagement?
The work needs a few specific inputs from your side before it starts:
- A Google Workspace administrator who can approve the OAuth client and enable the People API, or who can delegate that approval in writing.
- DNS and TLS access for the Mattermost site URL, because the redirect URI must use HTTPS and match the site address exactly.
- A pilot group of test users across the roles that will sign in, including at least one administrator.
- A named secrets owner for the client secret, its storage, and its rotation schedule.
- System Console administrator access on the Mattermost server, plus a staging environment where changes can be tested before production.
Should we use SAML or Entra ID instead of Google sign-in?
Choose the protocol that matches the identity provider your organization treats as the source of truth. If your users live in Google Workspace and you want Google accounts to sign in, OpenID Connect with Google is the right path. If your workforce directory is Microsoft Entra ID, Okta or another SAML provider, the sibling topics on SAML and Entra ID cover those options in detail. Compare how each method handles attribute updates and deactivation of leavers, because sign-in alone may not refresh profile data or remove departed users. The official Mattermost SAML single sign-on guide is a useful reference for the SAML side of that comparison.
What happens to existing email accounts when Google sign-in is turned on?
Turning on Google sign-in does not automatically convert every existing account, and users with email and password accounts keep their current login until their authentication method changes. Matching depends on the email address on each Mattermost account lining up with the Google account, so mismatched addresses are the first thing to check. Moving accounts is handled with the mmctl user migrate-auth command, which uses a mapping file, supports dry runs, and keeps message history attached to each user. Run the migration in a staging copy first and confirm the results with a dry run before changing production accounts.
How DeployOpen scopes and delivers Mattermost Google sign-in
DeployOpen plans, implements, documents and supports self-hosted open-source platforms inside your own infrastructure, including the identity settings that connect them. For Mattermost sign-in with Google Workspace, we agree the OpenID Connect configuration, the Google Cloud setup and the handover in writing before work starts.
How we scope
- Confirm your Google Workspace domains, the Mattermost server URL and whether the server uses TLS before any configuration starts.
- Agree in writing which Google Cloud project, OAuth client and People API settings are in scope and who owns each one.
- Record which Mattermost attributes Google will supply, and which profile fields your team will keep managing in Mattermost or Google.
How we build
- Create the Google OAuth client and register the Mattermost redirect URI exactly as the server address requires.
- Enable the People API in the agreed project and enter the discovery endpoint, client ID and secret into the System Console.
- Test sign-in with pilot accounts, including a user outside the allowed domain, and record the results for review.
How we hand over
- Deliver a written configuration record covering the OAuth client, redirect URI, discovery endpoint and secret storage location.
- Document which user attributes do not sync back from Google and how your team should maintain them afterward.
- Walk your identity and collaboration owners through the test results, rollback steps and the secret rotation procedure.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after the fixed-scope engagement ends.
- Plan a review of the sign-in configuration whenever Mattermost server versions or Google Cloud settings change.
- Ask us to confirm scope, deliverables and timelines in a written quote that follows from the agreed requirements.

