Skip to content

Federated authentication in development environment

Tomás Palma edited this page Mar 12, 2025 · 11 revisions

You have turn the frontend up before the backend

1. Add an entry to the hosts of your PC with a redirect between tts-dev.niaefeup.pt to 127.0.0.1

By adding this, every time you type tts-dev.niaefeup.pt on the browser, it will redirect to the localhost in order for us to access the localhost container that way.

Linux

Add the following line to the /etc/hosts file:

127.0.0.1 tts-dev.niaefeup.pt

MacOSX

Add the following line to the /etc/hosts file:

127.0.0.1 tts-dev.niaefeup.pt

Windows

Follow this guide.

2. Add certificates

In order to use federated authentication we need to have a valid Fully Qualified Domain Name and we need to support HTTPS.

In order to support HTTPS, we need to have a certificate in the backend.

That certificate needs to be signed by a Certificate Authority (CA). Due to this, we have to add a new CA to the browser.

The certificate files are available in the NIAEFEUP Google Drive Folder.

2.1. Add certificate authority to the browser

This is the rootCA.crt file.

2.1.1. Chromium based browsers (Arc, Brave, Chrome)

  1. Access the security settings by typing chrome://settings/security to the url.

  2. Click on Manage certificates

  3. Import the certificate using the rootCA.crt file.

2.1.2. Firefox

2.2. Add certificate to the backend

This is the server.key file, which is the private key for the certificate. The certificate is already set inside the nginx folder in the backend.

Add the server.key file to the nginx/cert folder on the backend.

3. Add your sigarra credentials to the .env.dev

image

The SIGARRA_USERNAME is the mecanographical number not including up (for example, 202112345 instead of up202112345)

4. Add the oidc secret

image

Ask the project coordinator or someone that has these credentials

5. Change the backend url on the frontend

Change the VITE_APP_BACKEND_URL to https://tts-dev.niaefeup.pt/api in the .env file on the frontend.

6. Turning the frontend and backend on

Currently, the frontend must be already running when the turning on the backend.