1
0
mirror of https://github.com/keycloak/keycloak.git synced 2026-10-23 19:29:23 +03:00

315 Commits

Author SHA1 Message Date
Paddy Buckley
cd07c64583 Updating AuthorizationTokenEncryptionTest.java to the new tests framework (#53284)
Closes #53283


Signed-off-by: Paddy Buckley <paddy.buckley@ibm.com>
2026-10-22 14:13:45 +02:00
Alexander Schwartz
2775ce2b20 Avoid exceptions on cleanup if previous setup failed
Closes #54209

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
2026-10-21 17:06:34 +02:00
Alexander Schwartz
cb202b06a0 Make the HTTP lifecycle bound to the Keycloak instance
Closes #54211

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-21 17:04:43 +02:00
Bernhard Strähle
b2544d7b30 Run all realm, user and client cleanup tasks in test framework even if one fails
Closes #53649

Signed-off-by: Bernhard Strähle <bernhard.straehle@gmail.com>
2026-10-21 16:13:52 +02:00
Bernhard Strähle
7f9fb5877a Support injecting organizations in the test-framework
Previously, a RealmConfigInterceptor applied to every realm created within a test class, and it couldn't distinguish which realm it is decorating.

AbstractInterceptorHelper contains now an applies(..) filter that defaults to true, and Interception exposes the interceptor annotation, which is available whether or not the interceptor has been deployed. An interception that does not apply is skipped before it is applied, logged, or registered as a dependent of the intercepted instance. RealmConfigInterceptor exposes this as appliesTo(..).

Existing interceptors inherit the default and keep applying to every realm.

Closes #51751
Closes #51752

Signed-off-by: Bernhard Strähle <bernhard.straehle@gmail.com>
2026-10-12 12:05:50 +02:00
Erik Jan de Wit
351a4e9f7b fixes CVE-2026-92358 by removing stale SUO proof (#53418)
fixes: #53061

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
2026-10-09 13:43:23 +00:00
Ricardo Martin
5d3d3d9980 Do not chek critical status for key usage validations (#53109)
* Do not chek critical status for key usage validations.
Provide perovider options for backwards compatibility.
Closes #52982

Signed-off-by: rmartinc <rmartinc@redhat.com>

* Move X509BrowserLoginTest and X509DirectGrantTest to the new CI
Closes #52982

Signed-off-by: rmartinc <rmartinc@redhat.com>

* Migrate tests to the new CI
Closes #52982

Signed-off-by: rmartinc <rmartinc@redhat.com>

* Do not initialize stores is tls is not enabled in ManagedCertificates
Closes #52982

Signed-off-by: rmartinc <rmartinc@redhat.com>

---------

Signed-off-by: rmartinc <rmartinc@redhat.com>
2026-10-06 13:14:27 +02:00
Simon Vacek
38f29b2f00 Update Registry to use FatalTestClassException
Closes: #53322

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>
2026-10-05 07:35:00 -03:00
Lorenzo Rocca
9b7c2d4fd7 Send the response headers HttpServerUtil is given
sendResponseHeaders transmits the header block, so the headers the caller passed
were being added to the response after it had already gone out and never reached
the client. The only current caller does not assert on them, which is why this
went unnoticed.

Also: Fix that responses without a body don't have a transfer encoding.

Closes #52362

Signed-off-by: lorexoff <rocca.lorenzo04@gmail.com>
Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Co-authored-by: Alexander Schwartz <alexander.schwartz@ibm.com>
2026-10-03 13:23:59 +00:00
Lukas Hanusovsky
5e54f0100e Migrate AbstractOIDCScopeTest + Fix LoginTotp pages in the new test-framework. (#53357)
Closes #53286


Signed-off-by: Lukas Hanusovsky <lhanusov@redhat.com>
2026-10-02 14:35:56 +02:00
Šimon Vacek
4eb7ca3c35 Create a WebAuthnRealmUpdater for tests (#52251)
* Create a WebAuthnRealmUpdater for tests

Closes: #52091

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

# Conflicts:
#	tests/webauthn/src/test/java/org/keycloak/tests/webauthn/registration/WebAuthnOtherSettingsTest.java

* remove deprecated methods and rename lambda

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

* depricate other RealmBuilder WebAuthn methods

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

* fix incorrect method delegation

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Šimon Vacek <86605314+vaceksimon@users.noreply.github.com>

---------

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>
Signed-off-by: Šimon Vacek <86605314+vaceksimon@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-09-30 17:01:14 +02:00
Pedro Igor
f906286deb Keeping existing validations and more test coverage
Signed-off-by: Pedro Igor <pigor.craveiro@gmail.com>
2026-09-30 11:05:17 -03:00
Šimon Vacek
9e75c7dead Migrate ConditionalCredentialAuthenticatorTest (#52072)
* Move ConditionalCredentialAuthenticatorTest to the new testsuite

Closes: #52070

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

* logout after each test in favor of lifecycle=method

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

---------

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>
2026-09-30 11:02:08 +02:00
Alexis Rico
8009a55b72 Resolve the organization when an invitation is confirmed
InviteOrgActionTokenHandler sets the organization on the request context
in preHandleToken, which is only reached through
LoginActionsService.preHandleActionToken and so only runs on the
registration entry points. An invitee who already has an account opens
the action token URL, which executeActionToken dispatches straight to
handleToken, leaving the context organization unset.

Organizations.resolveOrganization then has neither a context
organization nor an ORGANIZATION_ATTRIBUTE auth note, falls through to
the membership check an invitee cannot pass yet, and returns null, so
FreeMarkerLoginFormsProvider leaves org out of the login form model.
An organization aware theme therefore cannot brand the confirm
membership page and can only name the organization by its name.

Set it in handleToken as well, under the same rule as preHandleToken:
for an existing member, or once the invitation is known to be valid, so
a revoked or expired link does not expose the organization's
attributes.

Cover it from the new test framework, with an organization login theme
in the custom providers that prints what the org bean exposes, and give
RealmBuilder a loginTheme option so the test can select that theme.

Closes #52396

Signed-off-by: Alexis Rico <sferadev@gmail.com>
2026-09-23 14:44:41 -03:00
Šimon Vacek
19521970a6 Pass login_hint on attempted Organization authentication (#52585)
* Pass login_hint on attempted Organization authentication

Closes: #52268

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

* fallback to attempted_username if login_hint null

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

---------

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>
2026-09-23 17:21:51 +02:00
Alexander Schwartz
a8294005ad Cross-check if testcontainer reuse is enabled in the environment
Closes #52710

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
2026-09-23 10:45:35 +02:00
Alexander Schwartz
e9207bbaa5 Fix ordering so it is deterministic
Closes #53054

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
2026-09-23 10:44:31 +02:00
Chance Coleman
ce5f9ce6dc Resolve Kubernetes IdP issuer from discovery
Closes #49039

Signed-off-by: UnicornChance <chance@defenseunicorns.com>
2026-09-23 07:40:49 +00:00
Yike Gao
fa53959d68 Migrate VerifyProfileTest to the new test framework
Closes #51639

Signed-off-by: Yike Gao <yikegao8@gmail.com>
2026-09-23 09:33:21 +02:00
Erik Jan de Wit
f30758a397 Migrate user/profile tests to the new test framework (#52280)
* Moving user/profile tests to the new test suite

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* Migrate user-profile tests to test framework

Move the user-profile migration for issue #50768 to the new test framework APIs, including the custom user-profile provider wiring. Fix provider deployment and registration page behavior needed to keep the migrated tests stable.

Closes #50768

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* Add user package to base test suites

Include org.keycloak.tests.user in Base3TestSuite so the base suites coverage check recognizes the migrated user-profile package.

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* Apply Spotless formatting for user-profile migration

Reorder imports in migrated user-profile tests to satisfy spotless:check in Keycloak CI.

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* Remove user package from legacy base-suite matrix

Drop the obsolete testsuite user package entry from the legacy base-suite shard list now that user/profile tests are migrated to tests/base.

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* Skip body staleness wait for HtmlUnit page reloads

HtmlUnit form submission is synchronous, so waiting for the body element to become stale after login submit times out and makes SessionRestServiceTest flaky in Base2TestSuite.

Closes #52283

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* Restore SMTP config after validation test and fix WaitUtils compile error

Prevent class-scoped realm state from leaking allowutf8=true to later
UserProfileTest methods, and remove orphaned merge code that broke
test-framework/ui compilation.

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

* Address PR review feedback for user-profile test migration

Restore UPConfig after registration UI tests and run UPConfigUtilsTest as a plain unit test without booting Keycloak.

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>

---------

Signed-off-by: Erik Jan de Wit <erikjan.dewit@gmail.com>
2026-09-18 09:24:46 -04:00
Alexander Schwartz
024fb12d5d Clear caches on jdbc-ping reconnect
Closes #52696

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
2026-09-17 11:49:33 -03:00
vramik
32b207e18d Multi-idp for orgs: REST API
Closes #48910

Signed-off-by: vramik <vramik@redhat.com>
2026-09-09 10:05:46 -03:00
Lukas Hanusovsky
bdfdba236f [OID4VCI] Conformance Non Haip configuration and execution. (#52271)
Closes #51389


Signed-off-by: Lukas Hanusovsky <lhanusov@redhat.com>
2026-09-09 08:27:29 +02:00
vramik
932cee4307 JpaOrganizationProvider and IdentityProviderStorageProvider support for idp-org relationship
Closes #48908

Signed-off-by: vramik <vramik@redhat.com>
2026-09-08 09:31:20 -03:00
Alexander Schwartz
36b2618c61 Stabilize Chrome tests (#52416)
Chrome CDP throws "Node with given id does not belong to the document" instead of StaleElementReferenceException.

Closes #52415

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
2026-09-07 12:08:16 +02:00
Alexander Schwartz
3da1c41ac9 When staying on login page with an error, wait for the error to appear after a submit
Closes #52074

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
2026-09-04 07:41:36 -03:00
Alexander Schwartz
2f0a5f2882 Stabilizing tests like FlowTest.testRemoveExecutionSubflow
This avoids leaking events from previous tests

Closes #52329

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
2026-09-04 07:38:51 -03:00
Šimon Vacek
2041c326cf Remove tests module dependency on arquillian (#52334)
* Remove dependency on Arquillian

Closes: #52333

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

* code review fixes

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

* format JwksProvider to reflect legacy TestingOIDCEndpointsApplicationResource

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

* add managed user

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

* remove unused resources

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

* code review fixes

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

* copilot suggestion

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>

---------

Signed-off-by: Simon Vacek <vaceksimon-github@pm.me>
2026-09-04 10:12:41 +00:00
Alexander Schwartz
0574e7ffb8 Adding CLI option for the cluster and node name
Closes #51855

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Signed-off-by: Alexander Schwartz <alexander.schwartz@gmx.net>
Co-authored-by: Pedro Ruivo <pruivo@users.noreply.github.com>
2026-09-03 08:59:22 -04:00
Lukas Hanusovsky
9b43a60d5b Fixing WebDriver issues when using WaitUtils
Closes #52283

Signed-off-by: Lukas Hanusovsky <lhanusov@redhat.com>
2026-09-02 13:44:54 +00:00
Lukas Hanusovsky
76fb33f5a8 Conformance Test Suite - Refactor (#52026)
Closes #52025


Signed-off-by: Lukas Hanusovsky <lhanusov@redhat.com>
2026-09-01 13:51:06 +02:00
Alexander Schwartz
5b237cd738 Don't wrap exceptions when running tests remotely in the new test framework
Closes #51968

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
2026-08-27 20:02:55 +00:00
Alexander Schwartz
7974e7a989 Stabilize test PasskeysUsernameFormTest.passwordLoginWithNonDiscoverableCredential
Closes #52074

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
2026-08-27 16:36:57 +02:00
Yike Gao
c56216b817 Migrate remain login page to keycloak theme.
Closes #51620

Signed-off-by: Yike Gao <yikegao8@gmail.com>
2026-08-26 11:10:35 +02:00
Alexander Schwartz
b9b70f95f7 Implement asynchronous DB commit for Oracle and MSSQL
Closes #52012

Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Signed-off-by: Alexander Schwartz <alexander.schwartz@gmx.net>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
2026-08-26 08:13:34 +02:00
Peter Zaoral
e1c84daeba Fix DistributionKeycloakServer hanging on Windows when server startup… (#52008)
* Fix DistributionKeycloakServer hanging on Windows when server startup is slow

Closes #51790

Signed-off-by: Peter Zaoral <pzaoral@redhat.com>

* Fix DistributionKeycloakServer hanging on Windows when server startup is slow

Closes #51790

Signed-off-by: Peter Zaoral <pzaoral@redhat.com>

---------

Signed-off-by: Peter Zaoral <pzaoral@redhat.com>
2026-08-25 12:00:24 -04:00
Steven Hawkins
1346f48711 fix: renaming the admin client tests module for use by the operator (#51675)
closes: #50598

Signed-off-by: Steve Hawkins <shawkins@redhat.com>
2026-08-24 15:14:32 -04:00
Yike Gao
5b3632e15b migrate WebAuthnOtherSettingsTest and fixed flaky test.
Closes #51256

Signed-off-by: Yike Gao <yikegao8@gmail.com>
2026-08-24 15:49:16 +02:00
Ricardo Martin
6d95a8addd Integrate client secret rotation with client admin api v2 (#51615)
Closes #51535
Closes #51527

Signed-off-by: rmartinc <rmartinc@redhat.com>
2026-08-18 09:23:23 -04:00
Ricardo Martin
0b9e007dcd Move RecoveryAuthnCodesAuthenticatorTest to the new CI
Closes #51169

Signed-off-by: rmartinc <rmartinc@redhat.com>
2026-08-18 11:06:27 +02:00
Ruchika Jha
20df90972a Test cases migration: userSessionLimits (#51231)
* Moving files to the new test suite

Signed-off-by: Ruchika <Ruchika.Jha1@ibm.com>

* Move KcOidcUserSessionLimitsBrokerTest,KcSamlUserSessionLimitsBrokerTest to the new testsuite

Signed-off-by: Ruchika <Ruchika.Jha1@ibm.com>

* Resolved the pr review  comments

Closes #47811

Signed-off-by: Ruchika <ruchika.jha1@ibm.com>

* changed the superclass

Closes #47811

Signed-off-by: Ruchika <ruchika.jha1@ibm.com>

* changed the constant to abstract class

Closes #47811

Signed-off-by: Ruchika <ruchika.jha1@ibm.com>

---------

Signed-off-by: Ruchika <Ruchika.Jha1@ibm.com>
Signed-off-by: Ruchika <ruchika.jha1@ibm.com>
2026-08-12 14:57:09 +02:00
Bernhard Strähle
175fc1626b Disable syslog-counting-framing for SysLogServer in test-framework (#51551)
* Disable syslog-counting-framing for SysLogServer in test-framework

Signed-off-by: Bernhard Strähle <bernhard.straehle@gmail.com>

* Add regression test for SysLogServer

Signed-off-by: Bernhard Strähle <bernhard.straehle@gmail.com>

---------

Signed-off-by: Bernhard Strähle <bernhard.straehle@gmail.com>
2026-08-10 15:10:41 -04:00
Francesco Poli
38e0c10ca1 Complete Identity Provider DSL support in test framework
Add missing builder methods to IdentityProviderBuilder and
introduce IdentityProviderMapperBuilder to provide a fluent API
consistent with the rest of the RealmBuilder DSL.

Closes #51359

Signed-off-by: Francesco Poli <polifr@gmail.com>
2026-08-06 10:36:56 +00:00
Michal Vavřík
c1cfde7d5e introduce a new keycloak admin client based on jackson 3 (#50848)
Closes: https://github.com/keycloak/keycloak/issues/48216

Signed-off-by: Michal Vavřík <dev@michalvavrik.net>
2026-08-05 16:13:56 +02:00
Ricardo Martin
5bb6a163d3 Add tests for implicit flow in Token Exchange and delegation parameterized type
Closes #51152

Signed-off-by: rmartinc <rmartinc@redhat.com>
2026-08-02 04:28:46 +02:00
Ricardo Martin
1e27812ea3 Migrate ClientSecretRotationTest to the new CI
Closes #50886

Signed-off-by: rmartinc <rmartinc@redhat.com>
2026-07-27 13:51:28 +02:00
Vlasta Ramik
b8a99e07c9 Migrate Organization Authentication tests into new testsuite
Closes #48179

Signed-off-by: vramik <vramik@redhat.com>
2026-07-16 19:55:15 +02:00
Vlasta Ramik
69d75a07d2 Migrate organization member package to the new testsuite
Closes #48184

Signed-off-by: vramik <vramik@redhat.com>
2026-07-14 12:14:47 +02:00
Pedro Ruivo
ba4dd682d6 Fix clustering test
Closes #50750

Signed-off-by: Pedro Ruivo <1492066+pruivo@users.noreply.github.com>
Co-authored-by: Pedro Ruivo <1492066+pruivo@users.noreply.github.com>
2026-07-10 23:54:18 +02:00
Pedro Ruivo
816027691c Rename and make cacheless feature Preview
Closes #50619

Signed-off-by: Pedro Ruivo <1492066+pruivo@users.noreply.github.com>
Signed-off-by: Alexander Schwartz <alexander.schwartz@ibm.com>
Co-authored-by: Pedro Ruivo <1492066+pruivo@users.noreply.github.com>
Co-authored-by: Alexander Schwartz <alexander.schwartz@ibm.com>
2026-07-06 19:30:26 +02:00