Keycloak OpenID Connect login for ASP.NET Core

Connect an ASP.NET Core web app and its APIs to a Keycloak realm using the OpenID Connect handler, a confidential client with code flow and PKCE, and JWT bearer validation. Covers the settings, mappings and checks that decide whether sign-in works in production.

On this page

How ASP.NET Core signs users in through Keycloak

The supported method is the ASP.NET Core OpenID Connect handler configured as a confidential client in your Keycloak realm, using the authorization code flow with PKCE for the web app, while your APIs validate JWT bearer tokens issued by the same realm. The two halves do different jobs. The web app exchanges the code for tokens on the server, then stores the session in an encrypted ASP.NET Core cookie, so the browser never holds an access token. APIs receive the access token from the caller and check its signature, issuer, audience and expiry without a cookie. Keycloak's documentation recommends OpenID Connect and OAuth 2.0 flows over the deprecated Keycloak adapters, so a new .NET project should not start from an adapter package.

Before writing code, decide which clients the realm needs. Your team will typically create one confidential client for the MVC or Razor Pages app, with a redirect URI and a post-logout redirect URI that match your deployed hostnames, and one client or audience for each API. Confirm in your Keycloak version's admin console how client authentication, PKCE code challenge method and the audience mapper are set, since these settings decide whether the handler and the API checks will agree on the token. Keep the client secret in a secret store, not in appsettings.json, and plan how it rotates.

The cookie session makes the web app's logout and token lifetime questions important. When the cookie expires or the user signs out, ASP.NET Core only clears its own session unless you also redirect to Keycloak's end-session endpoint, so plan that flow with your single logout design. Also confirm with your security team how long access tokens and the cookie session should last, because a long cookie can keep a user signed in after an access change in Keycloak. Test a locked or disabled account, a revoked role and a sign-out from a second application before you call the design complete.

What you need before configuring the client

Most delays in an ASP.NET Core and Keycloak login project come from missing prerequisites rather than from the handler configuration itself. The six items below cover the Keycloak side, the network and certificate path, the .NET toolchain and the people who own secrets, so each can be confirmed before anyone edits a client.

A supported Keycloak instance

Confirm that the Keycloak server runs a release the project still supports before you build against it. The current release is 26.8.1, published October 13, 2026, so check whether your instance is on that line or on an older minor release. Note the upgrade path now, because the 26.8 upgrade notes change behavior such as SMTP StartTLS enforcement and backchannel logout token validation that can affect your login flows.

Upgrading guide

A realm your team owns

Create or confirm a dedicated realm for the application rather than placing it in the master realm. The team that configures the ASP.NET Core client should hold realm administration or delegated rights for that realm, so that redirect URIs, client scopes and role mappers can change without waiting on another group. Record who can export realm settings, since they hold client configuration you will need to reproduce in other environments.

HTTPS trusted by the .NET host

Keycloak requires TLS for all communication, and the ASP.NET Core host must trust the certificate chain presented by Keycloak for discovery and token calls. Check that the metadata endpoint loads over HTTPS from the application host, that any private certificate authority is installed in the trust store the .NET process uses, and that the application's own public address serves a valid certificate, because the OIDC redirect will fail otherwise.

Reverse proxy with public frontend URLs

Configure the reverse proxy in front of Keycloak so that issuer and redirect URLs use the public hostname that browsers and your application see. Mismatched issuer values are a common cause of failed token validation in the handler. Keycloak's production guide also asks you to keep the admin console and Administration REST API on a different hostname or context path from public frontend URLs, so confirm that split before you publish the realm.

Production guide

The .NET SDK your project targets

Identify the .NET SDK and target framework your project builds against, and confirm that the ASP.NET Core OpenID Connect and JWT bearer packages you plan to use support it. DeployOpen does not set a .NET version in this guide. Check the current ASP.NET Core documentation for supported runtimes and your organization's own policy, and pin the version in your project file and build pipeline so that the handler behavior you test is the behavior you ship.

A named owner for client secrets

Assign one person or role to own the confidential client secret, its storage and its rotation schedule. The secret must never appear in source control or appsettings files committed to the repository. Agree where it lives, such as a secret manager or Kubernetes secret, who can read it, and how a rotation reaches every running instance without a restart gap. Without this owner, the first credential rotation usually breaks sign-in in production.

Configuring the Keycloak realm, client and ASP.NET Core app

This sequence sets up a Keycloak realm and a confidential client with code flow and PKCE, then wires the ASP.NET Core OpenID Connect handler to it so a user can sign in and the app receives tokens. Each step ends with a check you can run before moving on.

  1. Create or select the realm

    Choose the realm that will hold the application's users, clients and roles. Use a dedicated realm for the application rather than the master realm, which is reserved for administrators. Your Keycloak administrator makes this change in the admin console or through configuration as code, and records the realm name, because every authority URL in the ASP.NET Core app includes it. The step is done when the realm exists, has the intended users or identity brokers attached, and its login page loads in a browser at the realm's address.

  2. Register the confidential client

    In the realm, create an OpenID Connect client with client authentication turned on, which makes it a confidential client that holds a secret on the server. Enable the standard flow (authorization code), and enable PKCE with the S256 challenge method so the code exchange is protected even if an authorization code is intercepted. Leave the implicit and direct access grant flows off unless a documented need exists. The step is done when the client appears in the realm with client authentication on and the standard flow enabled.

  3. Set exact redirect and logout URIs

    Enter the full HTTPS callback address the app uses, for example the path ASP.NET Core uses for its sign-in callback, as an exact valid redirect URI. Add a separate post-logout redirect URI for the page users reach after signing out. Avoid wildcards in production, because loose redirect patterns are a common route for token theft. Ask your security team to confirm the hostnames for each environment, since development and production usually need separate client entries. The step is done when a sign-in attempt from the app reaches Keycloak with a redirect URI that matches the registered value exactly.

  4. Decide on pushed authorization requests

    Decide whether the security design requires pushed authorization requests (PAR). With PAR, the app sends its authorization parameters to Keycloak over a back-channel call first, then redirects the browser with a short request reference, so parameters do not travel in the browser URL. If the design requires it, enable the require pushed authorization requests option on the client, and confirm that the ASP.NET Core handler and the Keycloak version in use support the flow in your environment. If PAR is not required, record that decision and why. The step is done when the client setting matches the written design and a test sign-in succeeds under that setting.

  5. Store the client secret outside source control

    Copy the client secret from the Keycloak client's credentials tab into your secret store, such as your cloud secret manager, Kubernetes secrets with encryption at rest, or a vault. Do not place it in appsettings.json or source control. In development, use the ASP.NET Core user secrets tool or environment variables, and give each environment its own secret. Plan a rotation procedure now, because rotating later requires updating the client and every deployed copy at once. The step is done when the application reads the secret from configuration at startup and the secret is absent from the repository.

  6. Configure authentication services in Program.cs

    In the ASP.NET Core project, call AddAuthentication with cookie as the default scheme and OpenIdConnect as the challenge scheme. Add AddCookie for the local session, then AddOpenIdConnect with the realm authority (the realm URL, not the admin console), the client ID, and the secret read from your secret store. Set the response type to code, request the openid, profile and email scopes plus any custom scopes, and set SaveTokens to true so the access and refresh tokens are kept in the session. Confirm that the authority's well-known endpoint, which is the discovery document, returns JSON from the realm when you open it in a browser. The step is done when the application starts without configuration errors.

  7. Verify the sign-in round trip

    Start the application, request a protected page, and confirm the browser redirects to the realm login page, that sign-in returns to the callback address, and that the user lands on the intended page with an authenticated session. Check the issuer claim in the token matches the authority you configured, and check that the audience and scopes are what the app expects. Sign out and confirm the post-logout redirect returns the browser to the registered page. Record the results in your test notes, because claim and role mapping and sign-out callbacks depend on this baseline. The step is done when repeated sign-in and sign-out succeed in the target environment.

How Keycloak claims become ASP.NET Core roles

Keycloak does not put roles in a single predictable place by default. Realm roles and client roles arrive in the token under realm_access and resource_access, which are nested JSON objects. ASP.NET Core's OpenID Connect handler and its JWT bearer handler only build ClaimsPrincipal.IsInRole checks from claims of a named type, so a nested object does nothing for [Authorize(Roles = "...")] until something flattens it. The fix is to add a protocol mapper on the client scope that writes roles into a flat claim, commonly named roles, and then point the middleware at that name by setting RoleClaimType in the token validation parameters. Without that setting, the role checks in the app will silently fail even when the user holds the right role.

The OIDC event hooks are the place to do any extra translation. In OnTokenValidated, the handler can read the flattened roles from the ID token or the userinfo response and add ClaimTypes.Role claims, which is useful when one realm serves several apps and each app should see only its own client roles. Audience and groups mappers need the same care. An audience mapper controls the aud claim that the API checks, and a groups mapper adds group paths that may include a leading slash depending on how it is configured. Confirm each mapper's output with a real token from a test user, because the exact claim layout depends on mapper settings in your realm and client scopes, and a mapper change in one client can alter what another client receives.

Mapping Keycloak tokens to ASP.NET Core identity

This table compares each Keycloak token element with the ASP.NET Core identity property it feeds, and marks where Keycloak needs a protocol mapper and where the ASP.NET Core application must transform claims. Read it before configuring the handler, because a missing mapper or an unexpected claim name is the usual reason a user signs in with no roles or an API rejects a valid token.

Token elementASP.NET Core targetWhere the work happens
Subject (sub)ClaimTypes.NameIdentifier, after the default inbound claim mappingKeycloak issues it by default. Confirm the handler maps it as expected in your ASP.NET Core version.
preferred_username or emailClaimTypes.Name (set via TokenValidationParameters.NameClaimType)Keycloak must include the claim in the ID token or userinfo response. Set the name claim type in the application, and confirm which claim your realm emits.
Realm rolesRole claims (set via RoleClaimType)Keycloak mapper required if roles are absent from the token. ASP.NET Core needs the role claim type set, and a transformation if roles arrive as a nested or single JSON value.
Client rolesRole claims, scoped to the clientKeycloak mapper required. Nested client role structures usually need custom code in ASP.NET Core to flatten them into individual role claims.
Custom user attributesApplication-defined claimsKeycloak user attribute mapper required. Map the claim name in the client's mapper settings, then read it by name in the application.
Audience (aud)Expected audience checked by the API's JWT bearer validationKeycloak audience mapper required when the API is not the token's client. Confirm the audience value and the validation settings for each API.
Issuer (iss)Expected issuer for OpenID Connect discovery and token validationKeycloak issues it from the realm URL. A mismatch between the public hostname and the configured authority causes rejected tokens.
Group membershipRole or policy claims, if the realm exposes groupsKeycloak group mapper required. Confirm the claim name and whether group paths need trimming in ASP.NET Core.

Protecting APIs with JWT bearer tokens

When the same ASP.NET Core application signs users in with the OpenID Connect handler and also exposes endpoints that its frontend calls, the simplest pattern keeps the API on the same host and reads the authenticated session. The browser holds an encrypted cookie, and the server-side code can call a downstream API with a token it acquires from the session. In this setup the API usually does not need JwtBearer at all, because the cookie already proves the user. Add JwtBearer only when the downstream service must validate a token itself, which keeps the trust boundary explicit.

  • Use the session first: Read the user from the cookie for endpoints served by the same application, and avoid exposing access tokens to browser JavaScript.
  • Request an audience for the downstream API: Add the API's audience to the client scopes in Keycloak so the token forwarded to that API is accepted by it.
  • Keep the token server side: Obtain the access token from the saved authentication properties and attach it to outgoing calls, rather than storing it in local storage.
  • Validate the audience at the API: If a separate service receives the forwarded token, configure its JwtBearer handler with the matching audience value.
  • Plan refresh behavior: Confirm how long access tokens last in your realm and how the handler refreshes them when they expire.

Before release, confirm that every endpoint either requires authentication or is intentionally anonymous, and that no API accepts tokens minted for a different client.

Sign-out callbacks and what logout can reach

Sign-out in this design has two layers, and the ASP.NET Core application must handle both. RP-initiated logout sends the user to the Keycloak OpenID Connect end-session endpoint, which ends the Keycloak session, and then Keycloak returns the user to a post-logout redirect URI. That URI must be registered on the Keycloak client, and it must match the value the application sends exactly. On the ASP.NET Core side, the cookie handler and the OpenID Connect handler both have to sign out. If only the cookie is cleared, the local session ends but the Keycloak session stays alive, so the next sign-in to any app in the realm can succeed silently. If only the OIDC handler is signed out, the application cookie may remain and the user still appears signed in locally. Confirm in a test that both sign-out calls run and that the browser ends on the registered redirect URI.

Application-level logout only reaches the application that starts it. It does not end sessions in other applications that trust the same realm, and it does not revoke access tokens that were already issued and are still valid. Reaching those sessions requires back-channel or front-channel logout, configured on each client and tested against each app, along with a deliberate choice of access token lifetime. Those decisions belong to the separate single logout design, covered in Keycloak single logout for OIDC and SAML applications, so this implementation should not promise that signing out here signs the user out everywhere.

Before you rely on this flow, list every application that shares the realm and decide what each one must do when the user signs out. Ask the team that owns each application whether it keeps its own session, and whether a sign-out in one app should end its session too. Record the answers, because they determine how much of the single logout design you need. A short sign-out test in a staging realm, with two applications signed in at once, will show quickly whether the gap matters for your users.

Security settings for the .NET client

The ASP.NET Core OpenID Connect handler holds the client secret, the session cookie and the redirect rules that decide who can sign in and where tokens land. Each card below is a setting to decide and verify against your Keycloak realm before the application goes to production.

Keep the client secret out of source

A confidential client authenticates to Keycloak with a secret, so the value must not sit in appsettings.json committed to source control. Load it from a secret store or from environment variables injected at deploy time, and rotate it through the Keycloak client credentials tab. Check that build artifacts, container images and log output never contain it.

Keycloak production guide

Require PKCE on the code flow

Configure the client for the authorization code flow with PKCE, even though it is confidential, so an intercepted authorization code cannot be redeemed by another party. In the ASP.NET Core handler, set the response type to code and confirm the challenge method is S256 in the Keycloak client settings. Test the sign-in once with PKCE enforced to catch clients that were created without it.

Decide on pushed authorization requests

Pushed authorization requests send the authorization parameters to Keycloak over a back-channel call and pass only a reference through the browser. Use them when the design needs parameters kept out of front-channel URLs or when parameter size is a concern. Confirm that your Keycloak version and the handler setting you choose support the flow together before you enable it.

Secure the session cookie

The handler stores the sign-in session in a cookie, so set CookieSecurePolicy to Always and choose a SameSite value that matches your redirect flow, then test that sign-in still completes in each target browser. Shorten the cookie lifetime for sensitive applications and confirm that sign-out clears it. Do not serve the application over plain HTTP at any point in the flow.

Match redirect URIs exactly

Register each redirect URI and post-logout URI in the Keycloak client as a full exact value, including scheme, host, port and path. Avoid wildcards that widen the set of destinations that can receive an authorization code. Review the list whenever a new environment or hostname is added, because stale entries are a common source of open redirect exposure.

Separate admin and public hostnames

Keycloak's production guide calls for TLS on all communication and for exposing the admin console and Administration REST API on a different hostname or context path from public frontend URLs. Point the ASP.NET Core issuer and metadata address at the public frontend hostname, and confirm that the admin paths are not reachable through the application's reverse proxy. Verify certificate validity on both hostnames.

Keycloak production guide

Common failures when Keycloak login breaks in ASP.NET Core

This table pairs the failures teams most often hit when ASP.NET Core sign-in or API calls fail against a Keycloak realm, with the likely cause in the configuration and the fix to check first. Work down the rows in order of the login flow, since a redirect or cookie problem usually hides the errors that follow it. Each cause is one that follows directly from the client, proxy, mapper or token settings described on this page.

FailureLikely causeFix
invalid_redirect_uri at Keycloak sign-inThe redirect URI sent by the app does not exactly match a Valid redirect URIs entry on the Keycloak client, including scheme, host, port and the /signin-oidc pathCopy the exact callback URL the app sends from the browser address bar or logs, then add that exact value to the client's valid redirect URIs. Avoid broad wildcards in production
Issuer mismatch or token rejected after loginThe app reads the issuer from an internal hostname, or Keycloak's frontend URL differs from the authority in appsettings, so the iss claim does not match the configured AuthoritySet the Keycloak frontend URL to the public hostname used by browsers and set the app's Authority to that same value. Confirm the reverse proxy forwards the original host and scheme headers
Correlation or nonce cookie errors after the redirect backThe cookie is set with SameSite or Secure settings that browsers drop on the return request, or the app runs over HTTP while the cookie requires HTTPSServe the app and Keycloak over HTTPS end to end, confirm the forwarded proto header is trusted by the app, and review the cookie SameSite and Secure options on the OpenID Connect handler
Users sign in but lack expected roles or claimsThe Keycloak client has no mapper that adds realm or client roles to the ID token or userinfo response, or the app reads a claim name that differs from the mapper's token claim nameAdd a client role or realm role mapper with the token claim name the app reads, enable it for the ID token and access token as needed, then compare decoded tokens against the app's role claim settings
401 Unauthorized on API calls with a valid-looking tokenThe access token audience does not include the API's expected audience, a common cause when the token was issued to a different client than the API validatesAdd an audience mapper to the calling client that names the API client or resource, request a token with that client, and set the API's ValidAudience to match the aud claim
Token rejected as expired or not yet validClock skew between the app host, the API host and Keycloak, or a cached signing key after the realm rotated its keysSynchronize server time on all hosts, check the signing key metadata at the realm's OpenID configuration endpoint, and allow the handler to refresh keys when the key identifier changes
Sign-out returns an error or lands on an unexpected pageThe post-logout redirect URI is not registered on the Keycloak client, so Keycloak refuses to return the browser to the appAdd the exact post-logout redirect URI to the client settings, match it to the app's SignedOutCallbackPath or configured redirect value, and test the full sign-out round trip
Login loop between the app and KeycloakThe app does not persist the authentication cookie, often because the cookie is blocked by SameSite rules or the app's data protection keys change between instancesUse a shared data protection key ring across instances, check the cookie attributes in browser developer tools, and confirm the app and Keycloak hostnames fit the browser's cookie rules

Questions teams ask before connecting .NET apps to Keycloak

How much effort does connecting an ASP.NET Core app to Keycloak take?

The effort depends mainly on how many apps, roles, APIs and custom claims are in scope, and on what sign-out behavior the business requires. A single web app with one confidential client, code flow with PKCE, and a basic role mapping is a small, bounded task. Each additional app adds its own client registration, redirect URIs, and secret handling. Each API that accepts JWT bearer tokens adds audience and issuer checks. Custom claims, group-to-role mapping, pushed authorization requests, and back-channel or front-channel sign-out each add configuration and test cases. Ask for a written scope that lists every app, API, role model and logout requirement before estimating effort.

Can our developers set this up alone using the Keycloak docs?

Yes, many teams do. The Keycloak documentation and the Microsoft ASP.NET Core documentation cover the OpenID Connect handler, the cookie authentication setup, and the JWT bearer handler. The harder parts are usually environmental: confirming the realm's client settings, the exact redirect and post-logout URIs, the token lifespans, and the claim names that Keycloak emits in your realm. Teams that have someone comfortable with OIDC concepts, a test realm to experiment in, and time to review the security settings often finish in-house. Teams without that experience, or with strict audit requirements for the configuration, often bring in a partner to review the design and test it.

What does the work need from our team?

The integration needs four things from your side. First, a realm owner who can create clients, mappers and roles, and who approves changes to the realm. Second, a non-production environment with a Keycloak instance and a copy of the app or API that matches production hostnames as closely as possible. Third, a named owner for client secrets and certificates, so the secret is stored in your secrets manager and rotated on a schedule you define. Fourth, sample test accounts with the roles each persona needs, including accounts that should be denied access. Without these, testing usually stalls at the point where the first real login fails.

How long does the integration take?

The duration is driven by scope, not by a fixed figure. The main variables are the number of applications and APIs, how many roles and groups must map to app permissions, whether custom claims come from user attributes or external systems, whether pushed authorization requests and single logout are required, and how many environments must be promoted. Approval cycles for realm changes and access reviews also add elapsed time that is outside the technical work. Ask for a timeline tied to a written scope with named deliverables and a test plan, and check which steps depend on your change-management process.

Does the ASP.NET Core handler work with the open source Keycloak release, and what does Red Hat build support add?

Keycloak is licensed under Apache 2.0 and supports OpenID Connect, so the standard ASP.NET Core OpenID Connect handler and JWT bearer authentication work with the open source release without a license fee for Keycloak itself. The Red Hat build of Keycloak is Red Hat's supported distribution based on the same open source project. What it adds is vendor support, a subscription, and Red Hat's maintenance and security processes for the build. Whether you need that support depends on your internal support model and procurement rules. Confirm the Keycloak version and distribution you will run, and check the Red Hat product page for current subscription terms.

What must we confirm in our target environment before starting?

Confirm the Keycloak version and distribution, the public hostname and TLS certificate chain, and whether the admin console and Administration REST API are on a separate hostname from public frontend URLs, as Keycloak's production guidance recommends. Check the reverse proxy forwarding headers, because wrong values cause redirect and issuer mismatches in ASP.NET Core. Confirm where your app runs (IIS, Linux containers, Kubernetes) and whether it sits behind a load balancer that terminates TLS. Confirm the identity sources and attributes you need, the token lifespans your security policy allows, and where client secrets are stored. Finally, confirm which API consumers must validate tokens locally and which need introspection.

Which settings cause the most login failures in ASP.NET Core with Keycloak?

The most common failures are issuer mismatches, redirect URI mismatches, and missing or misnamed claims. The issuer in the token must match the metadata address and the value the handler expects, which often breaks when the app reads the realm URL through an internal hostname. Redirect and post-logout redirect URIs must match the client configuration exactly, including scheme and port. Role claims in Keycloak are nested in the realm access claim by default, so the handler needs a claim action or mapper to read them as roles. Test each case with an account that has no roles and an account with the expected roles, and check the logs from the handler and the Keycloak event log.

How the login and API calls flow between browser, .NET app, Keycloak and API

The browser starts at the ASP.NET Core web app, which acts as the confidential client and redirects the user to Keycloak's authorization endpoint with code flow and PKCE. The app exchanges the code for tokens on a back-channel call to the token endpoint, so tokens never reach the browser. The browser then calls the downstream API with a bearer token, and the API validates the JWT signature and audience against the realm keys. Check that the back-channel path stays inside the trust boundary and that the API rejects tokens issued for other clients.

Login and API calls across browser, web app, Keycloak and API, with trust boundaries marked.

Testing the login, claims and API checks before go-live

Before go-live, the login, claim mapping and API checks should run as automated integration tests against a Keycloak realm that matches production settings, not as a one-time manual walkthrough. Start with a full sign-in for a test user holding each realm role the application maps, and confirm the ASP.NET Core app lands on the correct authorization policy. Add a user with no roles and confirm the app denies protected pages without crashing or falling back to a default role. Decode the ID token and access token for that user and check the shape: the iss value matches the realm URL, the aud and azp values match the client you configured, and the role and group claims appear where your TokenValidationParameters and claim mapping expect them.

Test the API layer with the same realm. Call the API with a valid token issued for its audience and expect success. Call it again with a token issued for a different audience and expect a 401 or 403, depending on how your JWT bearer configuration responds. Then use a token that has expired, which you can produce by waiting out a short access token lifespan in a test realm or by setting a short lifespan on a dedicated test client, and confirm the API rejects it. Finally, run a logout round trip that ends the Keycloak session and checks that the application cookie is cleared, and run a failed login path with a wrong password and a user who is disabled to confirm the app shows a safe error and does not expose token or error detail.

Keep these tests in source control and run them in CI against a disposable Keycloak instance seeded from the same realm export you deploy. Rerun the full set after each Keycloak minor upgrade, because the project says breaking changes in a minor release are opt-in, so a default that changed can alter claims or logout behavior without any error in the application. Confirm the exact version your environment runs before you plan the rerun, and treat a failing claim-shape test as a release blocker. The test suite is also the evidence your security team will ask for, so record which test accounts, clients and realm settings each case depends on.

How DeployOpen scopes and delivers this integration

DeployOpen plans and builds the ASP.NET Core OpenID Connect login against a Keycloak realm that runs in infrastructure you control. Each engagement is fixed-scope, with the client settings, claim mappings, logout behavior and API token checks agreed in writing before work starts.

How we scope

  • We confirm which ASP.NET Core web apps and APIs sign in to which Keycloak realm, and which users and roles each one needs.
  • We record the confidential client settings, code flow with PKCE, pushed authorization request use and redirect URIs in the written scope.
  • We agree the claim and role mapping, sign-out callback behavior and JWT bearer API checks as named deliverables before build.
  • Ongoing support, upgrades and continuous testing are available as a retainer after the fixed-scope work is delivered.

How we build

  • We configure the ASP.NET Core OpenID Connect handler and cookie settings against your realm in a non-production environment first.
  • We map Keycloak roles and client scopes to ASP.NET Core claims and authorization policies, so access rules live in one documented place.
  • We wire front-channel and back-channel sign-out callbacks and test that ending a session in one app behaves as the scope describes.
  • We configure JWT bearer validation for the APIs, checking issuer, audience and signing key handling against the realm you operate.

How we hand over

  • We deliver the realm and client configuration, the ASP.NET Core configuration files and a record of every mapping and policy decision.
  • We document the test cases we ran for sign-in, role-based access, token expiry, logout and rejected tokens, with results.
  • We walk your engineering and security teams through the configuration so they can review it and change it safely later.
  • We provide a findings list for any issue found during testing, with the fix applied or the open item and its owner recorded.

How we support

  • We can keep the integration current across Keycloak minor releases, reviewing each upgrade note that touches clients, tokens or logout.
  • We can retest sign-in, role mapping and logout after changes to the realm, the ASP.NET Core packages or the hosting environment.
  • We prepare evidence of access control and authentication settings for your internal reviews, while independent auditors perform any formal assessment.

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.