Skip to content

Conversation

@matheuscscp
Copy link
Member

@matheuscscp matheuscscp commented Dec 12, 2025

Closes: #518

  • Manual tests for Anonymous authentication type
  • Manual tests for OAuth2 authentication type with OIDC provider and Dex
  • e2e tests for RBAC
  • Docs

Config is looking like this:

# flux-operator --web-config=/etc/flux-status-page/config.yaml
apiVersion: web.fluxcd.controlplane.io/v1
kind: Config
spec:
  # Optional. Required if .spec.authentication.type is OAuth2.
  baseURL: https://flux-ui.apps.${CLUSTER_DOMAIN}

  # Optional. Sets insecure behaviors, e.g. HTTP cookie 'secure' field to false.
  insecure: false # Defaults to false.

  authentication:
    type: OAuth2 # Anonymous | OAuth2

    # Type-agnostic settings.
    userCacheSize: 200 # Default: 100
    sessionDuration: 24h # Default: one week

    # Type=Anonymous settings.
    anonymous:
      username: some-user
      groups:
        - some-group
        - another-group

    # Type=OAuth2 settings.
    oauth2:
      provider: OIDC # only OIDC is implemented for now. other providers could be Google, GitHub, Microsoft...
      clientID: flux-ui
      clientSecret: flux-ui-secret
      scopes: # Optional.
        - some-scope
        - another-scope

      # OIDC-only
      issuerURL: https://dex.apps.${CLUSTER_DOMAIN} # Required if .provider is OIDC.
      variables:
        - name: username
          expression: "claims.sub"
        - name: domain
          expression: "claims.email.split('@')[1]"
        - name: departments
          expression: "claims.groups.filter(g, g.startsWith('dept:')).map(g, g.substring(5))"
      validations:
        - expression: "variables.domain == 'example.com'"
          message: "email domain not allowed"
      profile:
        name: "variables.name" # Default: "has(claims.name) ? claims.name : (has(claims.email) ? claims.email : '')"
      impersonation:
        username: "variables.username"  # Default: "has(claims.email) ? claims.email : ''"
        groups: "variables.departments" # Default: "has(claims.groups) ? claims.groups : []"

@matheuscscp matheuscscp force-pushed the web-auth branch 2 times, most recently from 63493f0 to 518e98b Compare December 12, 2025 02:23
@stefanprodan stefanprodan added area/security Security related issues and pull requests area/web-ui Flux Status Page related issues and pull requests labels Dec 12, 2025
@matheuscscp matheuscscp force-pushed the web-auth branch 4 times, most recently from d614eb4 to b102508 Compare December 12, 2025 16:36
@stefanprodan
Copy link
Member

stefanprodan commented Dec 13, 2025

Login view when OIDC auth is configured:

Opera Snapshot_2025-12-13_172207_localhost

Signed-off-by: Matheus Pimenta <[email protected]>
@matheuscscp matheuscscp force-pushed the web-auth branch 2 times, most recently from 307e307 to 0d07eeb Compare December 15, 2025 20:25
Signed-off-by: Matheus Pimenta <[email protected]>
@matheuscscp matheuscscp marked this pull request as ready for review December 16, 2025 02:48
@stefanprodan stefanprodan changed the title web: introduce authentication web: introduce authentication (anonymous and OIDC) Dec 16, 2025
Copy link
Member

@stefanprodan stefanprodan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @matheuscscp 🥇

@stefanprodan stefanprodan merged commit 9b3e45c into main Dec 16, 2025
7 checks passed
@stefanprodan stefanprodan deleted the web-auth branch December 16, 2025 09:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/security Security related issues and pull requests area/web-ui Flux Status Page related issues and pull requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Web Single Sign-On with Dex and Keycloak

3 participants