Skip to content

initial authentication infrastructure - #274

Merged
willr3 merged 4 commits into
Hyperfoil:mainfrom
barreiro:useAuth
Aug 20, 2026
Merged

initial authentication infrastructure #274
willr3 merged 4 commits into
Hyperfoil:mainfrom
barreiro:useAuth

Conversation

@barreiro

Copy link
Copy Markdown
Member

Summary

  • Add quarkus-oidc-proxy extension to expose a /q/oidc discovery endpoint, allowing the frontend OIDC client to discover the identity provider through the backend. Dev profile auto-starts an OIDC server with test users (roles are assigned by h5m on first login).
  • Store OIDC sub and iss claims in UserEntity as stable identity. The provisioner and roles augmentor pattern-match on principal type (JsonWebToken vs plain principal) to dispatch user lookup accordingly.
  • Wire up frontend auth: AuthorizationContext/Provider injects OIDC tokens into Axios via interceptor, fetches the user role from /api/user/role, and exposes isAdmin/isAuthenticated. AuthActions component provides login/logout with token renewal and notifications.

Test plan

  • Start dev mode — OIDC server launches automatically with test users
  • Login via OIDC — username displays in the header (not "Anonymous")
  • First user gets ADMIN role, subsequent users get USER role
  • AutoProvisioningTest covers OIDC provisioning with sub/iss and the username-based path
  • API key auth remains functional with OIDC enabled
  • Create folder using CLI does not require authentication

@willr3 willr3 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

How are we / users going to specify the auth-server-url?


# OIDC - disabled by default (enable via environment for service deployments)
quarkus.oidc.tenant-enabled=false
quarkus.oidc.auth-server-url=${OIDC_AUTH_SERVER_URL:}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Does removing quarkus.oidc.auth-server-url=${OIDC_AUTH_SERVER_URL:} mean the quarkus.oidc.auth-server-url property must be in either a -D command line argument or in the .env when running h5m?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

yes. in a production setting the quarkus.oidc.auth-server-url for the provider will be specified, along with client-id + credentials-secret and others, using one of the several methods available to specify / override properties.

I see no point in having an alias, when the original quarkus properties are available and are well documented.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Would it be helpful to keep those properties in application.properties (possibly without values) so we know they must be defined / overridden when deploying h5m?

The oidc-proxy exposes a /q/oidc discovery endpoint so the frontend
OIDC client can discover the identity provider through the backend.
Dev profile auto-starts a OIDC lightweight server with test users
(alice, bob) — roles are assigned by h5m on first login.

remove principal-claim override (default sub)
- UserEntity: add optional sub/iss columns with unique constraint for OIDC identity
- UserServiceInterface: add bySub(sub, iss) lookup and create overload with sub/iss
- OidcUserProvisioner: pattern-match on JsonWebToken to extract sub/iss/username from JWT
- H5mRolesAugmentor/UserResource: dispatch user lookup by principal type (JWT vs username)
- application.properties: enable OIDC in test mode
- AutoProvisioningTest: add OIDC provisioning test with TestJwt
- pom.xml: add quarkus-test-security-oidc test dependency
Frontend: AuthorizationContext/Provider wires OIDC tokens into the Axios client
via interceptor, fetches the user role, and exposes isAdmin/isAuthenticated.
create AuthActions with login/logout actions with token renewal and notifications.
@willr3
willr3 merged commit 4b2faa0 into Hyperfoil:main Aug 20, 2026
2 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.

2 participants