Securing Quarkus applications with Keycloak

Connect Quarkus services and web apps to a self-managed Keycloak realm with quarkus-oidc, decide when the authorization extension is worth adding, and test locally with Dev Services.

On this page

How Quarkus applications authenticate against Keycloak with quarkus-oidc

A Quarkus service or web app that must sign users in, or accept bearer tokens from users and other services, needs a Keycloak realm that your team runs and controls. The application side is handled by quarkus-oidc, the OpenID Connect extension for Quarkus. It supports two modes: bearer token mode, where an API verifies an access token sent in the Authorization header on each request, and web app mode, where the application runs the OpenID Connect authorization code flow, holds a session and redirects users to Keycloak to sign in. Choosing between them is the first design decision, because it determines which Keycloak client type you create and where tokens are kept.

The realm, clients, client secrets, redirect URIs and realm roles all live on the Keycloak side and must be set before the Quarkus configuration can work. For each application, decide whether it is a confidential client with a secret, held on the server, or a public client, and confirm the exact redirect URIs and web origins your deployment will use. Keep the Keycloak issuer URL, the realm name and the client ID in one configuration source so that development, test and production differ only in values. Confirm these details against the Quarkus and Keycloak versions you plan to run, since the extension's configuration keys and defaults can change between releases.

This section covers configuration of both modes, mapping Keycloak roles and claims into Quarkus security identities, the security controls that apply to each mode, and how to test the result. It does not repeat the Keycloak client setup covered in the Keycloak integrations and Keycloak security hardening groups. The sections that follow assume the realm and client already exist, and they treat the Keycloak issuer, token lifetimes and logout behavior as fixed inputs to verify, not as defaults to accept.

What a Quarkus and Keycloak integration needs before work starts

A Quarkus application can only be secured as well as the identity provider behind it. The items below are the inputs the team should have settled before any quarkus-oidc configuration is written, because each one changes how the application is configured and tested.

A production Keycloak server

The integration needs a running Keycloak that the team operates or a partner operates for them, not a development instance started with the default dev-file database. The current release is 26.8.1, so confirm which minor version your environment runs before you read any configuration reference. The production guide requires TLS on all communication, a reverse proxy with path restrictions, and the admin console and Administration REST API on a hostname or context path separate from the public frontend URL. Quarkus clients will only be as reliable as this endpoint.

Production guide

A dedicated realm for the application

Create a realm for the Quarkus application rather than placing its client in the master realm or a realm shared with unrelated services. A dedicated realm gives you a clean place to define the client, roles, protocol mappers and test users, and it keeps administrator accounts separate from application users. Decide the realm name, token lifetimes and login settings now, because changing them later affects every client in that realm.

Quarkus version and build tooling

Record the Quarkus version, the build tool (Maven or Gradle) and the Java version the team uses. The quarkus-oidc extension and its configuration keys change between releases, so confirm every property name and default against the quarkus-oidc documentation for your exact Quarkus release. Also note whether the application runs in JVM mode or as a native image, since that affects reflection and build-time configuration in some setups.

DNS name and a certificate the runtime trusts

Quarkus validates the Keycloak issuer URL and fetches keys from its endpoints over HTTPS, so the certificate chain for the Keycloak hostname must be trusted by the Quarkus runtime. Private certificate authorities need their root added to the truststore the application uses, and the hostname in the issuer must match the one Keycloak advertises. Confirm these with a test request from the same container, host or pod where the application will run, not only from a workstation.

Keycloak administrator access for client setup

Someone must be able to create clients, roles, client scopes and protocol mappers in the target realm, and that access should come from named administrator accounts rather than a shared login. Agree who makes these changes, how they are recorded, and whether they are made by hand in the console or exported as configuration. Without this access, the integration stalls at the point where the application's client registration is needed.

Confirmed application URLs and redirect targets

List every public URL the application will use, including the root, login callback and logout return addresses for each environment. Web app flows require exact redirect URI matches in the Keycloak client, and a mismatch blocks sign-in. Include local development addresses if developers will test against a shared Keycloak, and decide who approves additions to the allowed list.

Configuring quarkus-oidc step by step

This sequence takes a Quarkus application from a Keycloak realm with no clients to a running app that validates Keycloak tokens or signs users in through the OpenID Connect code flow. Each step ends with a check you can run before moving on.

  1. Create the realm and separate clients

    In the Keycloak admin console, create or select the realm your applications will share, then create one client per application. Web apps that sign users in get a confidential client with client authentication turned on and a valid redirect URI for the app's callback path. APIs that only accept tokens get a client with an audience the API can check, and no browser redirect URIs. Record the realm name, client IDs and the client secret for each confidential client in your secrets store, not in source control. Check: the realm's OpenID discovery document loads at the realm's .well-known/openid-configuration path from a machine that will run the app.

  2. Add the quarkus-oidc extension

    Add the quarkus-oidc extension to the Quarkus project's build file, using the Quarkus version your team has standardized on. Keep the extension set minimal: quarkus-oidc provides bearer token and web app authentication, and the policy enforcer lives in a separate extension that this sequence adds only if needed later. Build the project once so the extension is resolved. Check: the project builds and the startup log shows the OIDC extension loaded without configuration errors.

  3. Set the server URL and client identity

    In application.properties, set quarkus.oidc.auth-server-url to the realm URL, which is the base of the discovery document without the .well-known suffix. Set quarkus.oidc.client-id to the client created in step one. Keep the client secret out of the file by referencing an environment variable or a secrets provider, for example through quarkus.oidc.credentials.secret. If Keycloak uses a certificate from an internal certificate authority, configure the trust store through the Quarkus TLS settings rather than disabling verification. Check: starting the app logs no discovery or TLS errors, and the realm URL responds over HTTPS from the app's host.

  4. Choose bearer or web app mode

    Set quarkus.oidc.application-type to service for an API that receives bearer tokens, or to web-app for a server-rendered application that runs the authorization code flow and holds a session. Use service for APIs called by SPAs, mobile apps or other services, and web-app only where the Quarkus server itself talks to the browser. Protect endpoints with @Authenticated or role annotations, and set the redirect path and logout path if you use web app mode. Check: an unauthenticated request to a protected endpoint returns 401 in service mode, or redirects to the Keycloak login page in web app mode.

  5. Verify issuer and audience on a real token

    Sign in as a test user, or request a token with a client credentials or password-free flow your team is permitted to use, and decode it. Confirm the iss claim matches the realm URL in quarkus.oidc.auth-server-url exactly, including scheme and realm name, and that the aud claim or the azp claim matches the audience the API expects. If the audience is missing, add an audience mapper to the client in Keycloak rather than loosening the check in the app. Set quarkus.oidc.token.audience once the value is known. Check: a valid token is accepted and a token from a different client or realm is rejected with 401.

  6. Add the policy enforcer only where needed

    Add the quarkus-keycloak-authorization extension and enable the policy enforcer only for resources whose access depends on Keycloak authorization services, such as resource-based permissions defined in the client's authorization settings. Keep the policy enforcer scope narrow, since each enforced path adds a policy evaluation. Confirm that the client has authorization enabled and that the resources and policies exist in the admin console before the app depends on them. Check: a user with the required permission reaches the resource, and a user without it receives 403 on the same path.

  7. Test locally with Dev Services and confirm production settings

    For local development, Quarkus Dev Services can start a Keycloak container and import a test realm, which keeps development separate from the shared realm. Before promoting the build, confirm that production configuration uses your own hostname, TLS, the secrets store for client credentials, and the same realm and client names as the environment it targets. Ask your platform team to confirm the Keycloak version and the reverse proxy path rules in front of the realm. Check: the same build passes the sign-in and 401 or 403 tests against the staging realm with no code change between environments.

Bearer token mode or web app mode: choosing the Quarkus authentication model

Web app mode fits a Quarkus application that serves pages to people in a browser. The application acts as an OpenID Connect client, redirects the user to Keycloak for sign-in using the authorization code flow, exchanges the code on the server, and keeps the resulting tokens tied to a server-side session. The browser only ever holds a session cookie, which is why this model suits server-rendered or Qute-style applications.

  • Client type: The Keycloak client is confidential, because the Quarkus server holds the client secret and performs the code exchange.
  • Redirect URIs: Each environment needs exact redirect URIs registered in the client, including the path Quarkus uses for the callback. Wildcards broaden the set of places tokens can be sent, so keep them narrow.
  • Logout: The application must end its own session and can trigger Keycloak logout, so the sign-out path and post-logout redirect need to be registered and tested.
  • Token storage: Tokens stay on the server in the session, so the browser never reads them. Session size and replication matter once you run more than one instance.
  • Proxy and hostname: Redirect URLs are built from the public hostname, so TLS termination and forwarded headers must be correct behind a reverse proxy.

Confirm in your Quarkus version how the OIDC extension names its web app configuration keys, how session cookies are secured, and how the callback path and logout behavior are configured.

When to add quarkus-keycloak-authorization and its policy enforcer

Add quarkus-keycloak-authorization when you want Keycloak's fine-grained authorization services, meaning resources, scopes, permissions and policies, enforced inside the Quarkus application instead of only checking roles in code. If your access rules are simple, such as a handful of roles mapped to endpoints, quarkus-oidc with role checks is usually enough and avoids a second authorization model to maintain. The extension earns its place when the same rules must be defined once in the realm, reviewed by people outside the development team, and applied consistently across several services. Each Quarkus service that uses the policy enforcer then depends on resources and permissions that exist in a specific Keycloak client, so the decision is as much about who owns the authorization model as about the code.

The trade-off is coupling. Your application code now reflects Keycloak's authorization model, and changing a resource name, scope or policy in the realm can change behavior in production without a code change. Policy design has to be finished in the realm before the application can be tested against it, and a policy that is too broad or too narrow fails silently unless someone checks it. Plan a test for every permission path that matters, including denied cases, and run those tests against a Keycloak realm built from the same exported configuration you deploy. Also confirm which policy types, resource matching behavior and enforcer settings the current extension supports, and read the Quarkus Keycloak authorization documentation for the version you run before committing, because behavior can differ between releases.

Using Dev Services for Keycloak in local development

Dev Services gives each developer a disposable Keycloak alongside the Quarkus application, which speeds up sign-in work. The cards below separate what that convenience covers from what production still needs, and how to keep the local realm from quietly diverging from the one you ship.

What Dev Services starts

With the Quarkus Keycloak tooling, a Dev Services instance starts a disposable Keycloak container when the application runs in dev mode or under tests, and the application points at it without manual configuration. Developers get a working OIDC issuer for bearer token and web app flows on day one. Check that the container image version matches the Keycloak release your production environment runs, because a different version can change defaults and admin behavior. Confirm the exact Dev Services behavior for your Quarkus version in its guide before relying on it.

Keycloak docs

What Dev Services does not replace

A disposable container does not prove production readiness. It typically runs without the TLS, reverse proxy, hostname and database settings your environment uses, and its default storage is for development only. Treat passing local sign-in as evidence that the code works, not that the identity setup is ready. Plan a separate pre-release run against a production-like Keycloak with TLS, the supported production database and the same hostname rules that the public frontend uses.

Realm drift between dev and production

A realm that developers edit in the local admin console can differ from production in client redirect URIs, token lifespans, required actions, role names and identity providers. Those differences often surface only after release, when a login flow or token claim behaves differently. Make a rule that realm changes are made in code or export files, not by hand, and compare the dev and production clients before each release. Name the owner who signs off on each difference.

Keeping realm exports versioned

Export the realm configuration to files kept in the same repository as the application, and review each change in a pull request like any other code. Strip or externalize secrets such as client secrets and user passwords before committing, and load them from the environment in deployed systems. Tag the export that matches each release so a rollback restores the matching realm. Record which Keycloak version produced each export, since a newer version may write fields an older one ignores.

Configuration differences to review before release

Before each release, review the settings that Dev Services never exercises: hostname and frontend URLs, HTTPS redirect and web origin values, the admin hostname separation, token and session lifespans, password and MFA policies, and the email delivery settings. Also check the client secret handling, the audience and role mappings the API expects, and the logout redirect targets. Keep the list in the repository so each release reviews the same items, and record who approved each difference.

Keeping test realms apart from production data

Automated tests often create users, clients and sessions in the Keycloak container they share with developers. Run tests against a fresh container or a realm imported for each run, and never point a dev or test profile at production identity servers or their admin credentials. Ask the team to confirm which Quarkus profile and Keycloak URL each environment uses, because a misconfigured profile is a common way production credentials reach local code.

Mapping Keycloak tokens to Quarkus identity and roles

This table maps each Keycloak token element to what quarkus-oidc exposes in the Quarkus security identity and how it is checked. Read each row as a decision point: the default claim behavior, what you must configure for roles, and what to confirm in your realm before writing @RolesAllowed rules.

Token elementWhat Quarkus uses it forWhat to configure or confirm
Subject (sub)Stable principal name for the security identity and audit trailsConfirm sub is present in access tokens from your realm. Do not key authorization on usernames that users can change.
Preferred usernameReadable principal name shown in logs and application viewsConfirm the claim is included in tokens for both user and service clients. Treat it as a display value, not a unique key.
EmailOptional attribute for application profiles and notificationsConfirm the email claim is added to tokens through a client scope or mapper. Missing email is common for service accounts.
Realm rolesRole names that @RolesAllowed can check, once the roles claim path is setBy default Quarkus does not read Keycloak's nested realm_access.roles path. Set quarkus.oidc.roles.role-claim-path to realm_access/roles or map roles to a top-level claim.
Client rolesRoles scoped to one client, usually needed for API permissionsSet the role claim path to the resource_access structure for your client ID, then confirm the exact names in a decoded token from your realm.
Audience (aud)Check that the token was issued for this API or web appSet quarkus.oidc.token.audience to the expected client or resource ID. Confirm that Keycloak adds the audience through an audience mapper.
Issuer (iss)Check that the token came from the expected realm URLMatch the issuer to quarkus.oidc.auth-server-url, including hostname and realm path behind reverse proxies.
Groups or organization claimsOptional group-based roles when the realm emits themConfirm whether your Keycloak version and realm include a groups or organization claim, and add a mapper if it does not. Map those values to role names deliberately.

Hardening the Quarkus and Keycloak connection

The Quarkus connection to Keycloak carries bearer tokens, client secrets and logout signals, so each hop needs a deliberate setting. The cards below cover the transport, secret storage, redirect and token checks, token lifetimes, logout and the Keycloak admin surface. Work through them before any Quarkus service faces users.

TLS on every hop

Quarkus should reach Keycloak over HTTPS for discovery, token exchange, JWKS retrieval and logout callbacks, and Keycloak should be served behind TLS as its production guide calls for. Check the quarkus.oidc.auth-server-url value uses https, that the certificate chain is trusted by the Quarkus runtime truststore, and that no internal hop falls back to plaintext through a proxy. Test with a broken certificate to confirm the application fails closed.

Keycloak production guide

Client secrets outside source control

The confidential client secret used for the authorization code flow must come from a secret store or environment injection at runtime, not from application.properties committed to Git. Quarkus supports resolving configuration from environment variables and external config sources, so reference the secret by name and keep the value out of build artifacts and container images. Plan rotation so the secret can change without a code release.

Exact redirect URIs

Register each redirect URI as a full, exact value in the Keycloak client, including scheme, host, port and path, and avoid wildcards that let an attacker supply a callback. Set quarkus.oidc.authentication.redirect-path and the post-logout path to match those registered values. Review the list whenever a new environment or hostname is added, since stale entries stay valid until someone removes them.

Issuer and audience validation

Quarkus OIDC verifies the token issuer and, where configured, the audience, so a token minted for another client or realm is rejected. Set the issuer to the exact realm URL that Keycloak advertises, and set the expected audience for each API so tokens issued to other services cannot be replayed against this one. Confirm the audience mapper is in place on the calling client, because Keycloak does not add it by default.

Short access token lifetimes

Access token lifetime in the Keycloak realm sets how long a stolen or revoked token stays usable, because a local JWT check does not contact Keycloak on each request. Choose a short access token lifespan that your users can tolerate with silent refresh, and keep refresh token policy and session idle timeouts aligned with it. Confirm the chosen values with your security team, since no universal number applies to every workload.

Logout through sessions and single logout

Quarkus web apps keep a session cookie, so logging out locally does not end the Keycloak session that other applications share. Configure RP-initiated logout with the post-logout redirect registered in Keycloak, and enable back-channel logout where the app can receive it. Test logout from one app and confirm the session ends in the others. Single logout behavior depends on each application's support, so verify it per client.

Admin console and admin API exposure

The Keycloak admin console and Administration REST API should not share a hostname or context path with public frontend URLs, as the production guide describes. Restrict them to administrator networks or a VPN, and make sure the reverse proxy blocks admin paths from the public internet. Quarkus services do not need admin access, so keep their service accounts scoped to the minimum client and realm roles they use.

Keycloak production guide

How to test the Quarkus integration before release

What should an integration test suite for a Quarkus app with Keycloak cover?

A useful suite covers five areas: a happy-path token test, negative token tests, role-based endpoint tests, a web app login walkthrough including logout, and a policy enforcer check when the enforcer is enabled. Each area maps to a specific failure that reaches production when it is missing. Run these against a Keycloak instance that matches your production realm settings, not only the default development realm, so client scopes, audiences and role mappers are exercised the same way they will be in production.

How do Dev Services for Keycloak help with automated testing?

Dev Services for Keycloak starts a Keycloak container for Quarkus tests and development without a manually managed server, so tests can run in a clean, repeatable environment on a developer machine or in CI. Use it for fast feedback, then keep at least one test pass against a Keycloak instance built from your production configuration, because realm imports, themes and client settings can differ. Confirm which Keycloak image and Quarkus test dependencies your build pulls, since they should match the versions you run in production.

Which negative token tests should a Quarkus API release include?

Include at least three negative cases: an expired access token, a token issued for a different audience, and an unsigned or wrongly signed token. The API should reject each one with a 401 response, and the test should fail if any of them reaches the endpoint logic. Also test a token from a different realm or issuer, since that catches misconfigured issuer URLs. Check the rejection path in CI so that a later configuration change cannot quietly relax validation.

How should role-based endpoint tests be designed for Keycloak roles?

Write one test per protected endpoint for each role that should pass and each role that should be denied, using tokens that carry the realm and client roles your mapper actually produces. Testing with hand-built tokens alone can miss mapping errors, so include at least one token obtained from Keycloak itself. Keep the role matrix in version control next to the code, so a change to a role name or a mapper breaks a test instead of an access rule in production.

What does a web app login walkthrough test need to check?

The walkthrough should confirm the full authorization code flow: a redirect to the Keycloak login page, a successful sign-in, a return to the registered redirect URI, a session cookie set by the app, and access to a protected page. Then test logout, confirming that the session cookie is cleared and that a protected page redirects to login afterward. Logout is a common gap, because the application can clear its own session while Keycloak still holds an active session. Decide in advance which logout behavior your release supports and test that behavior specifically.

How do you verify that the policy enforcer denies unauthorized paths?

When the policy enforcer is enabled, write tests that call each protected path with a token that lacks the required permission and assert a 403 response, then call the same path with a permitted token and assert success. Include paths that are not listed in the policy configuration, because the behavior for unmatched paths depends on your enforcer settings and should be confirmed explicitly. Run these tests against a realm that contains the resources, scopes and policies you deploy, since a missing resource definition can make a rule pass or fail for the wrong reason.

Who should confirm the test tooling against the Quarkus and Keycloak versions in use?

Your engineering team should confirm it, because the test libraries, Dev Services behavior and Keycloak image tags depend on the exact Quarkus and Keycloak versions in your build. Check the Quarkus and Keycloak release notes for the versions you run before you write the test plan, and record the pinned versions in the test documentation. If you outsource this work, ask the partner to list the versions it tested against and to rerun the suite after each upgrade. The Keycloak upgrade notes at the Keycloak upgrading guide are a natural next read for that check.

Common Quarkus and Keycloak failures and how to fix them

This table pairs each common failure with its likely cause, the fix, and the realm or client setting to check first. Read it by matching the symptom your application shows, then work through the checks in order. Most failures trace back to a mismatch between the issuer, redirect URI, claim path, audience or mapped policy paths that Quarkus and Keycloak both expect to agree.

FailureLikely causeFix and where to check
401 Unauthorized from an issuer mismatch behind a reverse proxyKeycloak issues tokens with the public hostname, but Quarkus discovers or validates against an internal address, so the iss claim does not match quarkus.oidc.auth-server-url.Set the public hostname and proxy headers in Keycloak, and point quarkus.oidc.auth-server-url at the same public issuer. Check the Frontend URL setting in the realm and the proxy forwarded headers configuration.
Redirect URI mismatch on web app loginThe redirect URI sent by quarkus-oidc differs from the Valid redirect URIs on the Keycloak client, often because of a trailing slash, http versus https, or a proxy-rewritten host.Confirm the exact callback URL the application builds, then add it to Valid redirect URIs on the client. Check that the Web origins and redirect scheme match the public address users see.
Missing roles because the claim path is wrongRealm roles and client roles sit in different token claims (realm_access and resource_access), and the configured role claim path does not point to them.Decode a sample access token and locate the roles. Set quarkus.oidc.roles.role-claim-path to the matching claim, and confirm the client roles mapper or realm role mapper is included in the client scope.
TLS trust errors on discoveryQuarkus cannot validate the certificate presented by the Keycloak HTTPS endpoint, usually because the issuing CA is private or the chain is incomplete.Add the CA certificate to the Quarkus truststore and reference it in configuration. Avoid disabling verification in production. Confirm the Keycloak hostname on the certificate matches the issuer URL.
Audience rejection of valid tokensThe access token's aud claim does not include the client or resource identifier Quarkus expects, since Keycloak does not always add the API client to the audience by default.Add an audience mapper to the client scope of the calling client so the API's client ID appears in aud. Then align quarkus.oidc.token.audience with that value. Check the client scopes tab on the calling client.
Policy enforcer denials on unmapped pathsquarkus-keycloak-authorization denies requests to paths that have no matching resource and scope in the policy configuration, or the enforcer runs in enforcing mode with incomplete paths.List every protected path in the Quarkus policy enforcer configuration and create matching resources, scopes and policies in the Keycloak client's Authorization tab. Test each path with a known user before switching to enforcing mode.
Login loop or repeated redirects after sign-inSession cookie is not accepted by the browser, often because the application runs behind a proxy with mismatched scheme or the SameSite setting blocks it.Check the application's public URL and secure cookie settings, and confirm the proxy passes the original scheme. Review the session cookie attributes in the browser developer tools.
Dev Services container cannot reach Keycloak from the appDev Services starts Keycloak in a container with a dynamic port or host, and hardcoded URLs in application properties point elsewhere.Use the configuration values Dev Services injects, or set the issuer from configuration rather than a fixed value. Confirm the realm import file matches the client IDs used in the application.

How a login and API call flow between the browser, Quarkus and Keycloak

The flow starts in the user's browser, which is sent to Keycloak to sign in through the authorization code flow, and the web app receives an authorization code back. Quarkus exchanges that code with Keycloak server to server, then stores the session it created for the browser. Later, an API call carries a bearer token that Quarkus checks against Keycloak's signing keys before running any code. Check that the token issuer, the client settings and the trust boundary between the public network and internal services match what you configured.

Browser, Quarkus web app, API and Keycloak exchange tokens during sign-in and an API call.

Who should own the realm, clients and Quarkus configuration

The split of responsibilities is the first decision in a Quarkus and Keycloak project, and it should be settled before any code is written. Platform owners typically run the Keycloak server itself: the realm and its keys, TLS on every hop, the database and its backups, the reverse proxy, and the upgrade schedule. Application teams own the Quarkus side: the quarkus-oidc settings in application.properties, the mapping of token claims to roles, the scopes each endpoint requires, and the tests that prove a given user can or cannot reach a given resource. Clients sit on the boundary between the two. Someone must decide who creates the client in Keycloak, who holds its secret or certificate, and who approves a change to its redirect URIs or allowed scopes, because a loosely controlled client is often where an otherwise sound setup fails.

Gaps usually appear where the two lists do not meet. A platform team may assume the application team will validate the audience of incoming tokens, while the application team assumes the realm was configured to issue tokens with that audience. Role mappers, token lifetimes and the realm's default client scopes can each change what a Quarkus service receives, so the written scope should name the owner of every one of them. It should also say who receives Keycloak upgrade notices and who retests the Quarkus services after a Keycloak minor release, since the upgrade notes for each release can change behavior that the application depends on. A short responsibility matrix attached to the statement of work, reviewed by both teams, is usually enough to close these gaps. Confirm the exact Quarkus and Keycloak versions in scope with your own environment before the matrix is signed.

Questions buyers ask about Quarkus and Keycloak integration

What drives the cost of a Quarkus and Keycloak integration project?

The main drivers are the number of applications, the authentication modes each one needs, the authorization model, and how deeply the tests go. A single service that only validates bearer tokens is a small piece of work. A set of web apps with browser login, service-to-service calls, and fine-grained policies in quarkus-keycloak-authorization requires more design, more client configuration in Keycloak, and more verification. Ask any provider for a quote that lists each application, its auth mode, the roles or policies it enforces, and the test cases it will run. Recurring costs come from upgrades and ongoing support, which are separate from the one-time build. DeployOpen does not publish prices. A quote follows from the written scope.

How long does a Quarkus and Keycloak integration take?

Duration depends on scope, not on the framework alone. The work usually moves through realm and client design, a build in local development, a configuration pass for each target environment, and testing with real users and tokens. Each additional application adds its own client registration, redirect URIs, role mapping, and test pass. Teams with an existing Keycloak realm and clear app owners move faster than teams that must first agree on roles and identity sources. Ask for a timeline tied to the agreed deliverables, and confirm which dependencies sit outside the provider's control, such as change approvals or access to staging environments.

What does our team need to provide before the work starts?

The work goes faster when the client supplies the following before it begins:

  • Administrative access to the target Keycloak realm, or a named admin who can create clients and roles there
  • A named owner for each application who can confirm redirect URIs, logout behavior, and required claims
  • Test users with the roles and groups each scenario needs, in non-production realms
  • Access to the development, staging, and production environments where the Quarkus services will run
  • A decision on the authorization model, including which roles or resources each service enforces

Missing items usually show up as delays in testing rather than in the build itself.

Can our internal team implement Quarkus with Keycloak on its own?

Yes, a team with Java and Quarkus experience and a working Keycloak administrator can build a basic quarkus-oidc integration without outside help. The Quarkus guides and the Keycloak documentation cover bearer token validation and web app login. The harder parts are usually the authorization design, policy enforcement across several services, secure handling of client secrets, and testing token edge cases such as expiry, audience mismatch, and missing roles. Teams often bring in a partner for those areas or for an independent review. Whichever path you choose, assign an owner who will keep the configuration current after go-live.

Should we add the Keycloak authorization policy enforcer, or stick with roles?

Role checks in code are often enough for coarse access, such as admin versus standard user. Add quarkus-keycloak-authorization and its policy enforcer when access depends on resources, scopes, or policies that should be managed centrally in Keycloak instead of in application code. The enforcer adds configuration in both Quarkus and the Keycloak client, so each protected resource needs a clear owner and a test case. Adding it later is possible, but moving decisions out of code after several releases tends to cost more than deciding at the start. Confirm the model with the application owners before you build.

What changes when we upgrade Keycloak or Quarkus?

Keycloak now ships four minor releases a year, and the project states that breaking changes in a minor release are opt-in. The current release is 26.8.1, published October 13, 2026. Upgrades still need a review of the Keycloak upgrade notes, since the 26.8 notes include enforced SMTP StartTLS, mandatory signature validation of backchannel logout tokens from external providers, and login failures persisted to the database by default. On the Quarkus side, check the extension versions against the Keycloak server version and rerun your token and policy tests. Keycloak migrates its database schema at startup by default, and large deployments can apply the SQL manually. Plan a staging run before each production change.

How do we test Dev Services and avoid differences between local and production?

Dev Services for Keycloak starts a container for local development, which makes it easy for engineers to run the app without a shared server. It is a development convenience, not a production target. The Keycloak database guide also notes that the default dev-file database is for development only. Confirm that your realm import, client settings, and roles are versioned and applied the same way in every environment, and run the same token tests against staging before release. Ask your provider how configuration will be promoted between environments and who approves each change.

How DeployOpen scopes and delivers Quarkus with Keycloak work

DeployOpen plans, builds, tests and documents Quarkus applications that sign users in and protect APIs against your own self-hosted Keycloak, inside your infrastructure. Engagements are fixed-scope, with the scope, deliverables and timelines agreed in writing before work starts.

How we scope

  • We confirm which Quarkus services are bearer-token APIs and which are web apps that need a confidential client and login flow.
  • We record the Keycloak realm, client, role and claim model each service expects, and which Dev Services or local setups developers will use.
  • We agree in writing whether policy enforcement with quarkus-keycloak-authorization is in scope, and which resources and paths it must protect.

How we build

  • We configure quarkus-oidc against your realm, with issuer, client and secret handling kept out of source control.
  • We implement role and permission mapping, then test token validation, expired tokens, wrong audiences and unauthorized paths.
  • We set up Dev Services for Keycloak for developers and confirm the same configuration runs in your staging and production environments.

How we hand over

  • You receive the configuration, client settings, mapping rules and test suite for each Quarkus service in the agreed scope.
  • We document the Keycloak client settings, redirect URIs and secret rotation steps your platform team needs to operate the integration.
  • We walk your engineers through the build, the tests and the known limits, so they can extend the integration without us.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers after handover.
  • Support can cover Quarkus and Keycloak version changes, including reviewing the Keycloak upgrade notes against your configuration.
  • Ask any provider to confirm response scope, change handling and who owns the code and configuration at the end of the engagement.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.