Skip to content

fix(login): honour x509Enabled and iconUrl on the login page#806

Merged
maany merged 7 commits into
rucio:mainfrom
Soap2G:feature-805-login-config
Jul 21, 2026
Merged

fix(login): honour x509Enabled and iconUrl on the login page#806
maany merged 7 commits into
rucio:mainfrom
Soap2G:feature-805-login-config

Conversation

@Soap2G

@Soap2G Soap2G commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Closes #805.

1. The x509 button can now be disabled

Login.tsx gated the OIDC and userpass buttons on their flags but rendered x509
anyways.

Also, X509_ENABLED was harvested by the env-generator but never emitted by .env.liquid.

Kind of important: X509_ENABLED is opt-out.
Deployments that never set it are unaffected. Anyone who did set X509_ENABLED=False
expecting it to work will now see the button disappear.

2. iconUrl is now rendered

OIDC_PROVIDER_<NAME>_ICON_URL is read by the gateway, emitted by .env.liquid
and populated onto OIDCProvider.iconUrl, but every OIDC button hardcoded the
same MdAccountCircle, leaving the setting unreachable.

One question/comment for @maany: this uses a plain <img> rather than next/image,
because the icon URL is provided at deploy time and its host therefore
cannot be allow-listed in next.config's images.remotePatterns.

The alternative would be to follow the community_logo_url precedent and
serve locally via next/image; that needs a rucio/containers change and
would have to handle one icon per provider. Happy to switch if you prefer that.

Testing

  • Added a test in test/component/Login.test.tsx asserting the x509 button
    is missing when x509Enabled: false, and that userpass/OIDC are unaffected.
    Verified it fails against unpatched Login.tsx and passes with the fix.

Soap2G added 2 commits July 17, 2026 14:09
The login page gated the OIDC and userpass buttons on their respective
flags but rendered x509 unconditionally, so a deployment that
authenticates only via OIDC had no way to hide it. x509Enabled was
already plumbed from the environment through the gateway, DTO, use case
and presenter into the view model, and then never read by the component.

X509_ENABLED was also missing from the env-generator: it was harvested
from the environment but dropped by the .env template, so the value never
reached the app. Emit it, and add the matching default alongside the
other login flags.

Note this is a behaviour change for anyone who already set
X509_ENABLED=False expecting it to work: the button now actually
disappears. Deployments that never set it are unaffected, as the flag
defaults to true.
OIDC_PROVIDER_<NAME>_ICON_URL was read by the gateway, emitted by the
.env template and populated onto OIDCProvider.iconUrl, but every OIDC
button hardcoded the same MdAccountCircle, leaving the setting
unreachable. Render the configured icon, keeping MdAccountCircle as the
fallback when none is set.

Uses a plain <img> rather than next/image: the icon URL is operator
supplied at deploy time, so its host cannot be allow-listed in
next.config's images.remotePatterns.
@Soap2G
Soap2G requested a review from maany July 17, 2026 12:19
@Soap2G Soap2G self-assigned this Jul 17, 2026
@maany

maany commented Jul 17, 2026

Copy link
Copy Markdown
Member

Thanks @Soap2G. Can you update the corresponding story files for the login page ?

…o#805

Add a BOIDCOnlyLogin story showing a deployment where userpass and x509
are both off, so the configured providers are the only login options, and
give the story's Indigo IAM provider an iconUrl so the branded and
fallback icons render side by side. The icon is served from ../public via
staticDirs, keeping the published Storybook independent of remote hosts.

Also add the matching component test for iconUrl, so both fixes in this
branch carry regression coverage.

Note ABasicLogin in 01_0_Login_MultiVO already sets x509Enabled: false and
previously rendered the button regardless; it now shows userpass only,
which is what the story always claimed to demonstrate.
@Soap2G

Soap2G commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

Hi @maany, done.

There's now a BOIDCOnlyLogin story (userpass and x509 off, OIDC only) and gave the story's Indigo IAM provider an iconUrl so the branded and fallback icons show side by side.

@maany

maany commented Jul 20, 2026

Copy link
Copy Markdown
Member

@Soap2G Thanks! Could you also update the containers to download the image locally and serve this locally via next image, that is indeed the correct way to do this.

@maany

maany commented Jul 21, 2026

Copy link
Copy Markdown
Member

@Soap2G I am taking this over and will make a release shortly

@Soap2G

Soap2G commented Jul 21, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @maany!!
FYI: rucio/containers#529

I thought that somehow it would have been linked..

@maany

maany commented Jul 21, 2026

Copy link
Copy Markdown
Member

I've pushed two commits onto this branch to serve the OIDC provider icons locally via next/image, as discussed:

  • bbd6827b — the gateway now derives iconUrl from a locally downloaded file: it returns /oidc-icons/<NAME>.png only when OIDC_PROVIDER_<NAME>_ICON_URL is set and public/oidc-icons/<NAME>.png exists, otherwise null. A missing or failed download degrades to the default icon instead of a broken image.
  • 74ca4522Login.tsx renders the local path with next/image (dropping the plain <img> and its lint-disable), and the component/story/gateway tests are updated accordingly.

The container side that downloads each icon into public/oidc-icons/<NAME>.png is in rucio/containers#530 (a download-only alternative to rucio/containers#529: the WebUI derives and existence-checks the path itself, so the container does not rewrite .env).

Note: provider names are upper-cased to form the filename on both sides, so the container and gateway always agree. Icons should be raster (png/jpg), matching the community-logo constraint.

@maany
maany merged commit efc9d50 into rucio:main Jul 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Login page ignores x509Enabled and iconUrl; X509_ENABLED never reaches the app

2 participants