Skip to content

Login and traits

Who may see what

Address Protection
*.development.test.…, *.staging.test.… always login via Keycloak; access for members of /apps/<project>
<project>.app.ccc-onconnect.de public — unless the component carries the trait oauth2-proxy
Portal platform.ccc-onconnect.de login; access for members of any group below /apps or /platform

Technically, every protected endpoint has its own oauth2-proxy with its own Keycloak client in front of it. The platform sets it up automatically — you configure nothing but the trait.

Your application only receives requests from logged-in, authorised people. Anyone who is logged in but not authorised sees a "403 · Zugriff verweigert" (access denied) page with a link to group management (https://groups.ccc-onconnect.de) and a log-out button.

No replacement for a login in the application

The proxy only decides "may enter / may not enter". If your application needs users, roles or per-person data, integrate Keycloak in the application itself (OIDC). Create the client for it yourself with the keycloak-client resource type.

Trait oauth2-proxy — login in production too

For applications that must not be public:

spec:
  traits:
    - kind: ClusterTrait
      name: oauth2-proxy
      instanceName: login
      parameters:
        groups: []                  # additional groups, full paths
        roles: [platform-access]    # additional Keycloak roles
Parameter Meaning
groups Additionally admitted Keycloak groups as full paths, e.g. /platform/developers. The project group /apps/<project> is always admitted.
roles Additionally admitted Keycloak roles: realm roles by name (platform-access), client roles as <client>:<role>.

Anyone who has one of the groups or one of the roles is admitted. The trait applies in all environments; in development and staging it thereby also widens the circle by the listed groups and roles.

Recipe "like the portal": roles: [platform-access]. All members of a group below /apps or /platform hold this realm role — exactly the circle allowed to use the portal. This guide itself is protected that way, for example.

Group and role changes

Groups and roles are part of the login token. After a change, the person affected has to log out and log in again once.

Further traits

Trait Purpose
custom-hostname additional hostname in production, see Endpoints and hostnames
health-probes liveness/readiness probes for the container
horizontal-pod-autoscaler scaling by load
persistent-volume-claim persistent storage for the container
vertical-pod-autoscaler resource recommendations and adjustment
observability-alert-rule alert rules on logs and metrics
portal-advertisement tile in the ONCOnnect portal, see Show in the ONCOnnect portal

Attach traits to the component in the portal or under spec.traits. Every trait needs an instanceName that is unique within the component. Set parameters per environment when promoting (traitEnvironmentConfigs).