---
title: Setting up Google OAuth authentication in Factry Historian
slug: how-tos/TrBh-setting
createdAt: 2025-10-21T11:46:37.000Z
---

## Requirements

Before setting up Google authentication, make sure that:

1. Factry Historian is accessible over **HTTPS**.
2. You have **administrative access** to a **Google Cloud project**.
3. Users exist in Factry Historian with a **username matching their Google login**.

:::hint{type="info"}
Factry Historian does not automatically create user accounts upon Google login.
Each user must first be added manually in the Historian administration interface.
:::

## Configure authentication

### Step 1: Creating a project in Google Cloud

Go to [https://console.cloud.google.com](https://console.cloud.google.com) and create a new project or open an existing one.

::Image[]{src="https://api.archbee.com/api/optimize/q2ez4Myy1Okvv4IuodiZe-vaOo14W4GkOPyGBWzX8g9-20250903-122919.png" size="50" width="821" height="681" position="center" showCaption="false"}

::Image[]{src="https://api.archbee.com/api/optimize/q2ez4Myy1Okvv4IuodiZe-bvc0bGUn6231TZLFzYgdA-20250903-122956.png" size="40" width="624" height="594" position="center" showCaption="false"}

### Step 2: Oauth consent screen

Open the menu on the top and click on OAuth consent screen under APIs and services.

::Image[]{src="https://api.archbee.com/api/optimize/q2ez4Myy1Okvv4IuodiZe-Y0dNd8JZYwauKcjKZD-5i-20250903-123055.png" size="40" width="685" height="837" position="center" showCaption="false"}

### Step 3: Allow Oauth login

Select User Type `Internal` to allow authentication of users configured within your Google organization and click **Create**.

::Image[]{src="https://api.archbee.com/api/optimize/q2ez4Myy1Okvv4IuodiZe--thTCvP0yMH0uLs3cdrL8-20250903-123133.png" size="50" width="919" height="595" position="center" showCaption="false"}

### Step 4: Fill in app details

Fill in the app information for the OAuth consent screen and leave the Scopes step empty.

::Image[]{src="https://api.archbee.com/api/optimize/q2ez4Myy1Okvv4IuodiZe-jvkGRg9s7yLXRqX77bAZ--20250903-123324.png" size="50" width="952" height="1535" position="center" showCaption="false"}

### Step 5: Create credentials

Open the credentials menu on the left and click create credentials on top. `Select OAuth client ID`.

::Image[]{src="https://api.archbee.com/api/optimize/q2ez4Myy1Okvv4IuodiZe-Izd_vPhIjEcval2SsRgeY-20250903-123354.png" size="50" width="2144" height="529" position="center" showCaption="false"}

### Step 6: Select application type

Select `Web application` under Application type.

::Image[]{src="https://api.archbee.com/api/optimize/q2ez4Myy1Okvv4IuodiZe-9WG97N0-btkJsxpFf-qiE-20250903-123419.png" size="50" width="921" height="529" position="center" showCaption="false"}

### Step 7: Fill in authorized origins

Fill in the fully qualified domain name into Authorized Javascript Origins on which the Factry Historian web application is reachable. E.g. `https://historian.mycompany.local`. This should be the same URL as configured under **Configuration -> Server Settings -> General -> BaseURL** in Factry Historian.

Under authorized redirect URI, fill in this base URL + `/api/auth/name/callback` and replace name with the name you will give the authentication provider you will configure in Factry Historian. E.g. if you name it MyGoogle, the redirect URI is `https://historian.mycompany.local/api/auth/MyGoogle/callback`.

Finally click **Create**.

::Image[]{src="https://api.archbee.com/api/optimize/q2ez4Myy1Okvv4IuodiZe-1VEtAA1jYB7wmwt9-4MIE-20250903-123724.png" size="50" width="889" height="1022" position="center" showCaption="false"}

### Step 8: Get credentials

Note the `Client ID` and `Client Secret`.

::Image[]{src="https://api.archbee.com/api/optimize/q2ez4Myy1Okvv4IuodiZe-gdiyxT-e2vGdQMDuRjcAG-20250903-123821.png" size="50" width="583" height="656" position="center" showCaption="false"}

### Step 9: Factry Historian configuration

Go to the administration interface of Factry Historian and go to **Configuration -> Server Settings -> Authentication Providers** and click the **Create provider** button.

Fill in the name, Client ID and Client secret from the previous steps and click **Save**.

::Image[]{src="https://api.archbee.com/api/optimize/q2ez4Myy1Okvv4IuodiZe-S61T56xDaFKedxqyS8IDR-20250903-123844.png" size="50" width="1533" height="887" position="center" showCaption="false"}

### Step 10: Create users in Factry Historian

In order to allow users to use Google Authentication you will need to create users in Factry Historian with a username equal to their Google login.

## Configure group mapping (manual only)

Currently Google oAuth does not allow an application (e.g. Factry Historian) to retrieve the groups that a users belongs to. This means that the Google oAuth authentication provider does not support automatic group mapping.
To grant privileges in Factry Historian to a user matching a Google login, manually assign the user to a user group in Factry Historian.

Alternatively: [LDAP](docId\:mQELnBfgpWDawlZmmdPtt) authentication can be configured with a Google Workspace to support automatic group mapping in Factry Historian.

## Troubleshooting

- [Troubleshooting Google OAuth authentication](docId\:DwlWIc_iPtAvIHRlXwYUJ)
