Running the OpenID Conformance Test Suite Against Keycloak. Run the OpenID Foundation conformance suite against Keycloak: Docker Compose setup, the two clients the Basic OP plan needs, reading logs, and rerunning in CI.
The OpenID Foundation’s conformance tests are free and available to anyone, so you can run them yourself. Start it locally with Docker Compose next to Keycloak (or use the hosted service at certification.openid.net), register two test clients in a realm, point the Basic OP test plan at the realm’s discovery URL, then run each test module and fix the failures it reports.
This walkthrough is for Keycloak operators and identity engineers who know OpenID Connect (OIDC) flows and realm setup but have never run the Foundation’s test plans or read their logs. The setup below pins Keycloak 26.8.2 and covers the Basic OP plan, which is the profile most OpenID Providers test. OpenID Connect Core defines an OpenID Provider (OP) as an “OAuth 2.0 Authorization Server that is capable of Authenticating the End-User and providing Claims to a Relying Party”, which is the role your Keycloak realm plays here.
Key takeaways
- The suite’s license file says it “is licensed under the MIT License”, and the Foundation says “the free suite of conformance tests are available to anyone”. Certification is the step that has a fee.
- The suite’s quick start uses prebuilt images, with “no source build required”, and Keycloak can join the same Compose network.
- Without dynamic registration the suite needs a second client “to test that authorization codes are correctly bound to a client”, so you create two confidential clients in the realm.
- Register the suite’s callback as an exact redirect URI. A wildcard at the end could accept the randomised redirect URI that one module sends to check that unregistered URIs are refused.
- The same plan can run in CI with the suite’s
run-test-plan.pyscript, which the suite’s wiki calls “likely the easiest way to incorporate the conformance suite into your own continuous integration pipelines”, and which makes it a useful check after every Keycloak upgrade.
What does the OpenID conformance suite test?
The suite plays the part of a relying party (the app that asks for a login) and checks how your provider answers. The Basic OP plan is defined in OIDCCBasicTestPlan.java, and at the time of writing that file lists 38 test modules. Going by their class names in that file, such as OIDCCIdTokenSignature, OIDCCScopeAddress, OIDCCAuthCodeReuse and OIDCCEnsureRequestWithValidPkceSucceeds, they exercise the authorization code flow, ID token signatures, the userinfo endpoint, the profile, email, address and phone scopes, the prompt, max_age, login_hint and ui_locales request parameters, authorization code reuse, redirect URI checks, client_secret_post authentication, request objects, refresh tokens and PKCE. In the suite’s code, checks carry a reference to a section of OpenID Connect Core 1.0: the scope checks in AbstractOIDCCReturnedClaimsServerTest.java, for example, are tagged OIDCC-5.4.
For each module, the suite builds an authorization request and sends a browser to Keycloak (1), the browser signs in (2), and Keycloak redirects to the suite’s callback with an authorization code (3). The suite then calls the token and userinfo endpoints and checks every answer (4), and records the module as passed, warning or failed (5).
Testing for yourself and certifying are different steps. The Foundation says implementers “can follow a self-certification process” using its tests, and its rule is that “Certification of a profile requires that you have ‘PASSED’, ‘REVIEW’, ‘WARNING’ or ‘SKIPPED’ results for all tests in the profile”, with no failed or interrupted ones. The tests themselves are free, so a local run is a sensible way to get there first.
Prerequisites
- Docker with the Compose plugin: the suite’s quick start begins with “Install Docker (with the Compose plugin)”.
- Permission to edit your hosts file (
/etc/hostson Linux and macOS). - A browser on the same machine, for the first manual run.
- Python 3 if you want the scripted run in the CI section.
Step 1: Start the suite and Keycloak with Docker Compose
The suite’s Build and Run guide offers a quick start with prebuilt images, which in its words “does not require cloning the source or building anything locally”. It has you visit the suite at https://localhost.emobix.co.uk:8443/, and it asks you to point that name at 127.0.0.1 in your hosts file, noting “This is required because the default BASE_URL uses that hostname”. We add a second name, keycloak, for the same reason: your browser and the suite both have to reach Keycloak at one address, because that address becomes the realm’s issuer.
echo "127.0.0.1 localhost.emobix.co.uk keycloak" | sudo tee -a /etc/hosts
mkdir conformance && cd conformance
curl -O https://gitlab.com/openid/conformance-suite/-/raw/master/docker-compose-prebuilt.yml
That command fetches docker-compose-prebuilt.yml with the same curl command the guide’s quick start gives.
Next to that file, save a small Compose file for Keycloak as keycloak-compose.yml:
services:
keycloak:
image: quay.io/keycloak/keycloak:${KEYCLOAK_VERSION:-26.8.2}
command: start-dev
environment:
KC_HOSTNAME: http://keycloak:8080
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: change-me
ports:
- "8080:8080"
Then start both files as one project, so they share one network:
docker compose -f docker-compose-prebuilt.yml -f keycloak-compose.yml up
Docker’s networking guide says each service joins the default network and is “reachable by other containers on that network, and discoverable by its service name”, so the suite’s containers resolve keycloak to the Keycloak container, while your browser resolves it through the hosts file to the published port. Setting the hostname option keeps the issuer fixed. Keycloak’s hostname guide describes hostname-strict as the option that “Disables dynamically resolving the hostname from request headers”, and the configuration guide lists “Strict hostname resolution is disabled” among the development mode defaults, so without a fixed hostname the browser and the suite could see different issuers. The admin variables are the ones the Keycloak container guide passes to docker run.
The same configuration guide says development mode has “HTTP is enabled”, which is fine for a throwaway test realm on your laptop. For a production-shaped setup with PostgreSQL and TLS, see our Keycloak Docker Compose guide. Open https://localhost.emobix.co.uk:8443/ and accept the local certificate warning to check that the suite is up.
Step 2: Set up the test realm and user
Sign in to the admin console at http://keycloak:8080/admin/ and create a realm called conformance. The scope modules ask for address and phone, and your test user needs values for those claims to be returned:
- In Realm settings, set Unmanaged attributes to Admin can edit, so that you can add attributes the user profile does not define. Keycloak’s guide says this policy “enables unmanaged attributes only from the administrative context for reads and writes”, and lists it among the settings “which restrict unmanaged attribute handling to the administrative context”. You can instead add the attributes to the user profile.
- Create a user, for example
conformance-user, with an email, a first name and a last name, and turn on Email verified. - On the user’s Credentials tab, set a password with Temporary off, so no “update password” page interrupts the automated logins.
- On the user’s Attributes tab, add
phoneNumber, the user attribute thatOIDCLoginProtocolFactory.javamaps to the phone number claim, andstreet,locality,region,postal_codeandcountry: the address mapper describes itself as mapping “user address attributes (street, locality, region, postal_code, and country) to the OpenID Connect ‘address’ claim”.
This realm exists only for the test, so keep its settings out of your production realms. If you also want to review what a fresh Keycloak ships with, our list of default configurations to adjust on a Keycloak cluster covers the ones that matter in production.
Step 3: Create the two test clients
The Foundation’s instructions say that without dynamic client registration “you are required to manually register three clients”: one for client_secret_basic, a second client_secret_basic client to test that authorization codes are bound to the client that requested them, and a client_secret_post client, which “may be the same client as the first one if your server permits one client to use either method”. Keycloak’s guide calls Client ID and Secret “the default setting”, and that authenticator’s code (ClientIdAndSecretAuthenticator.java) says it validates a client from “‘client_id’ and ‘client_secret’ sent either in request parameters or in ‘Authorization: Basic’ header”, so one client can use both methods and two clients are enough.
Create conformance-client-1 and conformance-client-2 under Clients with these settings:
| Setting | Value |
|---|---|
| Client type | OpenID Connect |
| Client authentication | On (a confidential client with a secret) |
| Authentication flow | Standard flow only |
| Valid redirect URIs | https://localhost.emobix.co.uk:8443/test/a/keycloak-basic/callback, exactly |
| Consent required | Off |
| Client authenticator (Credentials tab) | Client Id and Secret |
The last part of the redirect URI, keycloak-basic, is the alias you give the plan in the next step. The Foundation’s page says the alias “will form part of the redirect uri”, so the two must match. Keycloak’s guide says “Exact (case sensitive) string matching is used to compare valid redirect URIs” and “You can use wildcards at the end of the URL pattern”, but do not use one here, for the reason in the troubleshooting table.
Copy each client’s secret from its Credentials tab. Then open each client’s Client scopes tab and check that profile, email, address and phone are linked. Keycloak’s guide describes realm default client scopes as “sets of client scopes that are automatically linked to newly created clients”, so in a new realm they are normally there already.
Step 4: Write the test plan configuration
The plan reads one JSON configuration. The field names below follow the ones the suite’s own files use, such as its OIDC regression config and the OIDCCServerTestClientSecretPost module. Save it as keycloak-basic.json and paste in the secrets you copied:
{
"alias": "keycloak-basic",
"description": "Keycloak 26.8.2, Basic OP",
"server": {
"discoveryUrl": "http://keycloak:8080/realms/conformance/.well-known/openid-configuration"
},
"client": {
"client_id": "conformance-client-1",
"client_secret": "PASTE-CLIENT-1-SECRET"
},
"client2": {
"client_id": "conformance-client-2",
"client_secret": "PASTE-CLIENT-2-SECRET"
},
"client_secret_post": {
"client_id": "conformance-client-1",
"client_secret": "PASTE-CLIENT-1-SECRET"
}
}
In the suite, choose Create a new test plan, pick OpenID Connect Core: Basic Certification Profile Authorization server test (the displayName set in OIDCCBasicTestPlan.java), set the server metadata to discovery and the client registration to static_client, paste the JSON into the configuration, and choose Create Test Plan. The suite’s CI script runs the plan with those two choices among others, written there as oidcc-basic-certification-test-plan[server_metadata=discovery][client_registration=static_client] (run-tests.sh).
Step 5: Run the modules and handle the manual steps
Choose Run Test on each module in turn. When a module needs a login, the suite’s BrowserControl page says the URL is “placed into a queue and exposed in the UI for user interaction”, and you sign in at Keycloak as conformance-user. Before each module, read the blue box at the top of the test, which the Foundation’s instructions point to for what the module expects. Some modules ask you to clear Keycloak’s cookies first: the prompt=none module’s summary in OIDCCPromptNoneNotLoggedIn.java says it runs “expecting that no recent enough authentication is present” and asks you to “remove any cookies you may have received from the OpenID Provider before proceeding”, so a leftover session gives the wrong answer.
Some modules need a screenshot, because the suite cannot see the error or login page Keycloak shows. The summaries of three of them, quoted below from their source files, ask for one in every case:
oidcc-ensure-registered-redirect-urisends an unregistered redirect URI, and “the authorization server should display an error saying the redirect uri is invalid, a screenshot of which should be uploaded”. For an unregistered redirect URI, Keycloak’sAuthorizationEndpointChecker.javaraises its invalid parameter message forredirect_uri, whichmessages_en.propertieswords as “Invalid parameter: {0}”, so the page reads “Invalid parameter: redirect_uri”.oidcc-prompt-loginandoidcc-max-age-1each, in its summary, “calls the authorization endpoint test twice” so that the server is “required to ask the user to login a second time”, and each says “A screenshot of the second authorization should be uploaded” (see alsoOIDCCMaxAge1.java).
Two more, by their summaries, need one only when Keycloak shows an error page instead of redirecting back: oidcc-response-type-missing, which accepts an error redirect or “an error saying the response type is missing”, and oidcc-ensure-request-object-with-redirect-uri, which accepts a correct login or “an invalid redirect_uri error”. Take the screenshot and attach it with Upload Images: the Foundation’s instructions note that “in some cases, a screen capture is uploaded as evidence of passing the test”.
Automating the logins
Clicking through every module gets slow, and the suite can do the browser part itself. Its BrowserControl design page explains that it “can use a Selenium instance (with an internal, headless browser implementation) to mimic human interaction”, configured with “an additional block in the configuration JSON object named browser”, whose tasks match URLs and run commands such as text and click on each page (its example also uses wait). In Keycloak’s base login template, login.ftl, the form’s inputs have the IDs username and password and the submit button has kc-login, so a block like this signs in, with the login task marked optional for modules where Keycloak already has a session. Add it to keycloak-basic.json beside client2:
"browser": [
{
"match": "http://keycloak:8080/realms/conformance/protocol/openid-connect/auth*",
"tasks": [
{
"task": "Login",
"optional": true,
"match": "http://keycloak:8080/realms/conformance/*",
"commands": [
["text", "id", "username", "conformance-user", "optional"],
["text", "id", "password", "PASTE-TEST-USER-PASSWORD", "optional"],
["click", "id", "kc-login"]
]
},
{
"task": "Verify Complete",
"match": "*/test/a/keycloak-basic/callback*",
"commands": [["wait", "id", "submission_complete", 10]]
}
]
}
]
The screenshot modules need an override entry that waits for the page text and saves it as the evidence, A comment in the suite’s BrowserControl.java says that for a wait command “the final parameter can be ‘update-image-placeholder’ to mark an image placeholder as satisfied”. For the redirect URI module, add this at the top level of the configuration:
"override": {
"oidcc-ensure-registered-redirect-uri": {
"browser": [
{
"match": "http://keycloak:8080/realms/conformance/protocol/openid-connect/auth*",
"tasks": [
{
"task": "Expect redirect uri error page",
"match": "http://keycloak:8080/realms/conformance/*",
"commands": [
["wait", "xpath", "//*", 10, "Invalid parameter", "update-image-placeholder"]
]
}
]
}
]
}
}
For oidcc-prompt-login and oidcc-max-age-1, the suite’s own regression config has overrides for both modules whose login task uses an xpath wait ending in update-image-placeholder-optional. For Keycloak, you can match the text “Sign in to your account”, the loginAccountTitle message in messages_en.properties. The suite’s wiki says “It is recommended that OPs complete conformance testing successfully manually before attempting to automate the process”, so get one clean manual run first.
Somewhere to run this that stays patched
Everything above works the same on Skycloak, because it is real upstream Keycloak rather than a fork. What changes is who handles the upgrades, backups and security patches afterwards.
How to read the test logs
Each module has a log page and a log file you can download, which the Foundation’s instructions ask you to include, as “the url of the log-detail.html page or the downloaded log file”, when you send a question about a result. Start from the first failed entry and work upwards, since the entries before it record the steps that led to it. A WARNING result still counts towards certification under the Foundation’s rule quoted above. Some checks are written to warn rather than fail: in AbstractOIDCCReturnedClaimsServerTest.java, the checks that the requested scopes’ claims came back run with the WARNING result. Keep the downloaded log files when you want to compare runs.
Troubleshooting: common failures and the Keycloak setting behind each
| What the suite reports | Cause | Keycloak setting that fixes it |
|---|---|---|
oidcc-ensure-registered-redirect-uri fails with “redirected the user to the requested but randomised/unregistered redirect uri” |
The suite creates the bad URI “by appending a random path” (CreateBadRedirectUriByAppending.java), which a redirect URI ending in * can match |
Valid redirect URIs: the exact callback URL, with no wildcard |
| Keycloak shows “Invalid parameter: redirect_uri” on every module | The alias in the JSON does not match the path registered on the client | Valid redirect URIs: use the same alias in both places |
| The token request fails with a client authentication error | The client is public, or the secret in the JSON is stale | Client authentication on, and the secret copied again from the Credentials tab |
The address or phone scope module ends in WARNING |
The user has no values for those claims, or the scope is not linked to the client | The user’s Attributes tab, and the client’s Client scopes tab |
| The suite cannot load the discovery document, or the issuer differs between browser and suite | Keycloak builds URLs from request headers, or the hosts entry is missing | The hostname option (KC_HOSTNAME) set to http://keycloak:8080 |
| The automated login fails because an element is missing | A custom login theme changed the form’s element IDs | Update the browser commands to the IDs your theme uses |
Should you use the hosted suite instead?
The hosted service at certification.openid.net runs the same suite, and you sign in with a Google or GitLab account. Its redirect URI has the form https://www.certification.openid.net/test/a/ALIAS/callback, with your own alias in place of ALIAS, and the Foundation asks that the alias be unique to you. In every module the suite itself acts as the client (step 4 in the diagram above), so a hosted run needs a Keycloak that the hosted suite can reach. That is why we lead with the local run: it works with private realms and fits CI. For a certification submission, run the plan against the deployment you actually ship.
Rerun the plan in CI after every Keycloak upgrade
A passing plan is a good regression check, because an upgrade, a theme change or a realm change can each change what the provider answers. The suite’s wiki calls run-test-plan.py “likely the easiest way to incorporate the conformance suite into your own continuous integration pipelines”. The same wiki page tells you to set CONFORMANCE_SERVER “to the full base url of the server” and CONFORMANCE_DEV_MODE “to 1 if you’ve deployed the suite with authentication disable”, which it ties to the fintechlabs.devmode=true option. The Build and Run guide lists --fintechlabs.devmode=true as the default JAVA_EXTRA_ARGS of the prebuilt stack, so with it you set CONFORMANCE_DEV_MODE instead of an API token.
To start a realm in CI, export the one you built with kc.sh export --dir and import it at start-up with --import-realm. Keycloak’s import and export guide covers both commands and says “For the Keycloak containers, the import directory is /opt/keycloak/data/import”. Keycloak’s guide also says “A random secret is generated automatically, but you can override it with a specific value if needed”, which keeps the realm file and the test configuration in step. Then a GitHub Actions job can bring everything up and run the plan:
name: OpenID conformance
on:
workflow_dispatch:
pull_request:
paths: ["conformance/**"]
jobs:
basic-op:
runs-on: ubuntu-latest
env:
KEYCLOAK_VERSION: 26.8.2
CONFORMANCE_SERVER: https://localhost.emobix.co.uk:8443/
CONFORMANCE_DEV_MODE: "1"
DISABLE_SSL_VERIFY: "1"
steps:
- uses: actions/checkout@v4
- run: echo "127.0.0.1 localhost.emobix.co.uk keycloak" | sudo tee -a /etc/hosts
- run: git clone --depth 1 https://gitlab.com/openid/conformance-suite.git suite
- run: cp suite/docker-compose-prebuilt.yml conformance/
- run: docker compose -f conformance/docker-compose-prebuilt.yml -f conformance/keycloak-compose.yml up -d
- run: |
timeout 300 bash -c 'until curl -skf https://localhost.emobix.co.uk:8443/ > /dev/null; do sleep 5; done'
timeout 300 bash -c 'until curl -sf http://keycloak:8080/realms/conformance/.well-known/openid-configuration > /dev/null; do sleep 5; done'
- run: pip install -r suite/scripts/requirements.txt
- run: |
python3 suite/scripts/run-test-plan.py --export-dir results \
"oidcc-basic-certification-test-plan[server_metadata=discovery][client_registration=static_client]" \
conformance/keycloak-basic.json
- uses: actions/upload-artifact@v4
if: always()
with:
name: conformance-results
path: results
For this job, keycloak-compose.yml changes from Step 1: it mounts the folder that holds the realm export, saved as conformance/realm-export/conformance-realm.json, on Keycloak’s import directory, and adds --import-realm to start-dev. Docker’s merge rules say “Paths are evaluated relative to the base file”, which they describe as “the first Compose file”, and that file sits in conformance/ here:
services:
keycloak:
image: quay.io/keycloak/keycloak:${KEYCLOAK_VERSION:-26.8.2}
command: start-dev --import-realm
environment:
KC_HOSTNAME: http://keycloak:8080
KC_BOOTSTRAP_ADMIN_USERNAME: admin
KC_BOOTSTRAP_ADMIN_PASSWORD: change-me
ports:
- "8080:8080"
volumes:
- ./realm-export:/opt/keycloak/data/import:ro
The screenshot modules also need their override entries from Step 5 in keycloak-basic.json, so that the headless browser supplies the screenshots those modules ask for, using the update-image-placeholder argument that the comment in BrowserControl.java describes. When some modules do not finish, run-test-plan.py prints “Exiting with failure - some tests did not run to completion” and exits with an error code, which fails the job. Its options include --export-dir (“Directory to save exported results into”), --expected-failures-file and --verbose, which its help text says will “Print out details of unexpected failures/warnings including a template for the expected failures file”. Run it with --verbose once to get that template, which you then pass with --expected-failures-file after you have reviewed each entry. To test an upgrade, change KEYCLOAK_VERSION and compare the exported results with the last green run. Pin the suite too: the Build and Run guide says that “To pin to a specific release” you set IMAGE_TAG, so a suite change and a Keycloak change never land in the same run. Our posts on testing Keycloak and PostgreSQL upgrades with Docker Compose and on Keycloak CI/CD with GitHub Actions cover the rest of that pipeline.
What about the Implicit, Hybrid and FAPI plans?
Once Basic OP passes, the same setup runs the other plans. The Foundation notes that many providers “will also test the Implicit OP and Hybrid OP profiles”, which need clients allowed to use those response types. The suite’s README describes it as the suite “which covers OpenID Connect, FAPI1-Advanced, FAPI2, FAPI-CIBA and OpenID for Identity Assurance (ekyc)”, and the FAPI plans deserve their own walkthrough. Its repository also has a test-configs-authzen folder of AuthZEN configuration files, worth a look if you run Keycloak as a policy decision point, as in our AuthZEN post.
FAQ
Is the OpenID conformance test suite free?
Yes. The Foundation says “the free suite of conformance tests are available to anyone”, and the suite’s license file says it “is licensed under the MIT License”. Certification has a fee: for OpenID Connect certifications, the fees page lists member fees of “$700.00 USD per new deployment” and a non-member fee of $3500.00 USD, and it says “Open source implementations may be eligible for a fee waiver”.
Why does the OpenID conformance test need two clients?
A few modules check that an authorization code issued to one client cannot be used by another, which needs a second registered client. This walkthrough uses the static_client variant, so you create both clients by hand in the realm.
Can I run the OpenID conformance suite without internet access to Keycloak?
Yes, with the local Docker run. The suite and Keycloak share a Compose network, so the realm does not have to be public. The hosted service at certification.openid.net is the option that needs a Keycloak the hosted suite can reach.
Which OpenID conformance tests need a screenshot?
In the Basic OP plan, oidcc-ensure-registered-redirect-uri, oidcc-prompt-login and oidcc-max-age-1 ask for one in their summaries, and oidcc-response-type-missing and oidcc-ensure-request-object-with-redirect-uri ask for one when Keycloak shows an error page instead of redirecting back. You can upload it by hand, or let a browser override capture the page with update-image-placeholder.
Does passing locally mean my Keycloak is OpenID Certified?
No. Certification goes through the Foundation’s self-certification process, and the testing instructions end with a “Submission of Results” step, with every module in the profile passed, warning, review or skipped. A local pass tells you that your realm is ready for that run.
Next steps
Clone the conformance suite, start it beside your Keycloak realm, and run the Basic OP plan today, then add the scripted run to your upgrade checks so every new Keycloak version gets the same test. If you would rather have the Keycloak side run for you, take a look at our managed Keycloak hosting.


