Add new OpenID Connect client#
Gafaelfawr can also serve as an OpenID Connect server, allowing third-party applications running inside Phalanx and OpenID Connect clients outside of Phalanx environments to authenticate users in the same way that the Science Platform does.
Each OpenID Connect client of Gafaelfawr must be pre-registered and assigned a client ID and password. To complete an authentication, the client must authenticate with that client ID and password. See the Gafaelfawr documentation.
This page describes how to register a new client of Gafaelfawr. You will need the following information:
The Phalanx environment to which you’ll be adding the new client.
A short, human-readable name of the new client you’re adding.
The return URL to which the user will be sent after authentication.
Note
The instructions here are specific to SQuaRE-managed Phalanx environments.
For other environments, you should update the oidc-clients portion of your static secrets.
See Static secret sources for more information.
Add secret#
OpenID Connect clients are configured in the oidc-server-secrets key of the gafaelfawr secret.
The value of this key is a JSON representation of all of the clients.
It is therefore not maintained directly, but instead is generated from structured data stored elsewhere.
For SQuaRE-managed environments, “elsewhere” is the oidc-clients 1Password item.
To add a new client, use the following process:
Open 1Password. Go to the 1Password vault for static secrets for the Phalanx environment where you want to add an OpenID Connect client.
Create or edit an item named
oidc-clients. If it doesn’t already exist, create it as an item of type .Add a new section for the new client. Set the section title to a short, human-readable name for the OpenID Connect client. This name should be enough to tell someone looking at this secret what this client is used for.
Add a text field to the new section. Change the label to
id. Change the contents torandom-id.clients.fqdnwhere the random ID is the results ofos.urandom(16).hex()in Python and the FQDN is the FQDN of the environment. For example,de5dd2c1fbf648e11d50b6cf3aa72277.clients.data.lsst.cloud.Add a password field to the new section, changing the label as
secret. You can let 1Password generate a random 20-character password if you want, or generate one of equivalent entropy however you choose.Add a final text field to the new section. Change the label to
return_uri. Set the value to the return URL of the client. This should be provided by the OpenID Connect client and will be the URL to which the user is sent after authentication.
Configure Gafaelfawr#
If this is the first OpenID Connect client for Gafaelfawr, you will need to enable OpenID Connect server support.
Do this by setting config.oidcServer.enabled to true in the Gafaelfawr values-environment.yaml file.
See the Gafaelfawr documentation for more details.
If the purpose of this OpenID Connect client is to provide services to an IDAC or another external client that may need data rights information (see DMTN-253), ensure the configuration of the Gafaelfawr OpenID Connect server is correct and has a dataRightsMapping setting.
See the Gafaelfawr documentation for more information.
Then, whether or not you needed to make configuration changes, you will need to sync secrets for this environment. Follow the normal process (Sync secrets for an environment) to do that.
Finally, you will need to restart Gafaelfawr to pick up the new secret. Do this by selecting on the deployment in Argo CD (see Restarting a Deployment).
Note
Since this requires a Gafaelfawr restart, you will normally want to do this during a maintenance window for a production environment.