This project is an example of OAuth 2.0 authentication in FactoryTalk Optix using Microsoft Entra ID as the identity provider. It shows how to integrate a modern authentication mechanism into an industrial automation environment.
- FactoryTalk Optix (see the version badge above)
- A Microsoft Entra ID tenant where you can create an app registration
-
Install the CA certificate
The Web Presentation Engine (WPE)
localhostcertificate used by this project (ProjectFiles/PKI/Own/Certs/localhost.pem) is issued by the CA included in the project. The OAuth2 redirect URI ishttps://localhost/oauth2callback, so the browser must trust this CA.-
Navigate to the
ProjectFiles/ca-certdirectory. -
Locate the CA certificate file (
root_ca.crt). -
Install the CA certificate on your operating system:
-
Windows:
-
Open the certificate file.
-
Click "Install Certificate" and follow the prompts.
Place the certificate in the Trusted Root Certification Authorities folder.
-
Alternatively, from PowerShell as Administrator:
Import-Certificate -FilePath .\root_ca.crt ` -CertStoreLocation Cert:\LocalMachine\Root
-
-
Ubuntu:
-
Copy the certificate file to
/usr/local/share/ca-certificates/:sudo cp root_ca.crt /usr/local/share/ca-certificates/
-
Update the CA certificates:
sudo update-ca-certificates
-
-
Demo certificate: install this CA only on test machines, and remove it when you finish the evaluation.
-
-
Set up the Microsoft Entra ID app registration
In the Microsoft Entra admin center, under App registrations, create (or open) an application and:
- Add the redirect URI used by the project:
https://localhost/oauth2callback. - Create a Client Secret and copy its value.
- Under Expose an API, expose the application ID.
- Set the manifest to token version 2.
For the detailed procedure, see How to configure Microsoft Entra ID for OAuth2 authentication in FactoryTalk Optix.
- Add the redirect URI used by the project:
-
Configure the FactoryTalk Optix project
Open the project in FactoryTalk Optix and replace the placeholders in the project's Authentication settings with the values from your app registration:
Setting Value Issuer https://login.microsoftonline.com/<your Directory ID>/v2.0Authorization path /<your Directory ID>/oauth2/v2.0/authorizeToken path /<your Directory ID>/oauth2/v2.0/tokenJWKS path /<your Directory ID>/discovery/v2.0/keysAdditional scopes api://<your application id>/<your application expose name>Client ID / Client Secret From your app registration -
Run the project
Start the project in emulation mode and sign in using your Entra ID account.