Sign in with Google
Matrix Authentication Service (MAS) can offer “Continue with Google” next to its own username and password. MAS acts as the OpenID Connect client; Google is the upstream provider. This needs a Google Cloud project, so it is optional.
1. Create the OAuth client in Google
Section titled “1. Create the OAuth client in Google”-
In the Google Cloud console, open APIs & Services → Credentials and create an OAuth client ID of type Web application.
-
Add this authorised redirect URI:
https://account.<serverName>/upstream/callback/<provider-id><provider-id>is a ULID that you choose and keep stable (see below), for example01KV19W10A7JVQ50S71FRKYCAR. Generate a new one for your install. -
Note the client ID and client secret.
2. Keep the client secret in a Secret
Section titled “2. Keep the client secret in a Secret”Store the secret in a Kubernetes Secret instead of the values file:
kubectl -n vss create secret generic mas-google-oauth \ --from-literal=client_secret='<google-client-secret>'Use the External Secrets Operator instead if you keep secrets in a store: declare the ExternalSecret under extraObjects in your values, targeting the Secret mas-google-oauth.
3. Configure the provider
Section titled “3. Configure the provider”matrix-authentication-service: upstreamOAuth2: providers: - id: 01KV19W10A7JVQ50S71FRKYCAR # your own ULID, stable human_name: Google brand_name: google issuer: https://accounts.google.com token_endpoint_auth_method: client_secret_post client_id: "<google-client-id>" client_secret_existing: name: mas-google-oauth key: client_secret scope: "openid profile email"Apply it with helm upgrade. MAS syncs the providers on startup; open https://account.<serverName>/ and you should see Continue with Google.
A literal client_secret: "..." also works, but it ends up in your values file. Use it only for development.
- Redirect URI must match exactly, including the provider ID. A mismatch shows as
redirect_uri_mismatchon Google’s page. - Removing a provider needs
mas-cli config sync --pruneinside the MAS pod. Deleting it from the values alone does not remove it. - Account mapping. By default the local part of the user’s email becomes the Matrix username (
claims_importschanges this). - Admins.
matrix-authentication-service.policy.adminUserslists Matrix localparts that get admin rights, whatever login they use. - Other providers. The
providerslist takes any OpenID Connect provider. The chart also supports Sign in with Apple. Further MAS settings can be merged withmatrix-authentication-service.additional. - Password sign-in stays available unless you disable it (
matrix-authentication-service.passwords.enabled: false).