This project serves as an example to demonstrate OAuth2 authentication capabilities. It includes a Docker Compose setup that leverages Keycloak with a configured realm and client for OAuth2 with PKCE (Proof Key for Code Exchange).
This project aims to showcase the integration of advanced authentication mechanisms within industrial automation environments.
Note
An active internet connection is required for Docker to download the Keycloak image
-
Install CA Certificate:
- Navigate to the
ProjectFiles/docker/certsdirectory. - 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
-
-
- Navigate to the
-
Run Docker Compose:
Note
You can copy the entire folder to an external machine (or VM) that runs a Docker engine.
-
Open a terminal and navigate to the
ProjectFiles/dockerdirectory. -
Execute the following command to start the Docker containers:
docker-compose up
- Set the hosts file on Windows:
-
Open Notepad as administrator, then open the file:
C:\Windows\System32\drivers\etc\hosts -
Add the following line at the end:
127.0.0.1 keycloak.ftoptixdemo.oauth2
-
Important
If Docker is running on another machine, use the IP address of that machine instead.
- Start the FactoryTalk Optix Project:
- Open FactoryTalk Optix.
- Open the project.
- Start the project in emulation mode to test the OAuth2 authentication.