From 671d1c7aad0625475b310eb5bcc43e5d624fe66d Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Wed, 11 Oct 2023 10:46:46 +0200 Subject: [PATCH 01/11] Add dedicated feature flag for oauth device grant flow (#23891) The new flag "DEVICE_FLOW" is enabled by default for now. At a later stage we might disable the feature by default. Users can now disable the device flow support for the whole server via: -Dkeycloak.profile.feature.device_flow=disabled or --features-disabled=device_flow See discussion: https://github.com/keycloak/keycloak/discussions/23700 Fixes #23891 --- .../java/org/keycloak/common/Profile.java | 7 +- .../admin-ui/src/realm-settings/TokensTab.tsx | 144 +++++++++--------- .../admin-ui/src/utils/useIsFeatureEnabled.ts | 1 + .../protocol/oidc/OIDCWellKnownProvider.java | 18 ++- .../oidc/endpoints/AuthorizationEndpoint.java | 3 + .../oidc/endpoints/TokenEndpoint.java | 11 +- .../endpoints/DeviceEndpointFactory.java | 9 +- 7 files changed, 115 insertions(+), 78 deletions(-) diff --git a/common/src/main/java/org/keycloak/common/Profile.java b/common/src/main/java/org/keycloak/common/Profile.java index 417ae6302d16..71e36b48ec36 100755 --- a/common/src/main/java/org/keycloak/common/Profile.java +++ b/common/src/main/java/org/keycloak/common/Profile.java @@ -92,7 +92,12 @@ public enum Feature { DPOP("OAuth 2.0 Demonstrating Proof-of-Possession at the Application Layer", Type.PREVIEW), - LINKEDIN_OAUTH("LinkedIn Social Identity Provider based on OAuth", Type.DEPRECATED); + LINKEDIN_OAUTH("LinkedIn Social Identity Provider based on OAuth", Type.DEPRECATED), + + DEVICE_FLOW("OAuth 2.0 Device Authorization Grant", Type.DEFAULT), + + // Add new Feature above this line + ; private final Type type; private final String label; diff --git a/js/apps/admin-ui/src/realm-settings/TokensTab.tsx b/js/apps/admin-ui/src/realm-settings/TokensTab.tsx index efd761953c33..f8b7320a2555 100644 --- a/js/apps/admin-ui/src/realm-settings/TokensTab.tsx +++ b/js/apps/admin-ui/src/realm-settings/TokensTab.tsx @@ -27,6 +27,7 @@ import { import { useServerInfo } from "../context/server-info/ServerInfoProvider"; import { useWhoAmI } from "../context/whoami/WhoAmI"; import { convertToFormValues, sortProviders } from "../util"; +import useIsFeatureEnabled, { Feature } from "../utils/useIsFeatureEnabled"; import "./realm-settings-section.css"; @@ -43,6 +44,7 @@ export const RealmSettingsTokensTab = ({ }: RealmSettingsSessionsTabProps) => { const { t } = useTranslation(); const serverInfo = useServerInfo(); + const isFeatureEnabled = useIsFeatureEnabled(); const { whoAmI } = useWhoAmI(); const [defaultSigAlgDrpdwnIsOpen, setDefaultSigAlgDrpdwnOpen] = @@ -127,77 +129,81 @@ export const RealmSettingsTokensTab = ({ /> - - } - > - ( - + + } + > + ( + + )} /> - )} - /> - - - } - > - ( - field.onChange(field.value || 0 + 1)} - onMinus={() => field.onChange(field.value || 0 - 1)} - onChange={(event) => { - const newValue = Number(event.currentTarget.value); - field.onChange(!isNaN(newValue) ? newValue : 0); - }} - placeholder={t("oAuthDevicePollingInterval")} + + + } + > + ( + field.onChange(field.value || 0 + 1)} + onMinus={() => field.onChange(field.value || 0 - 1)} + onChange={(event) => { + const newValue = Number(event.currentTarget.value); + field.onChange(!isNaN(newValue) ? newValue : 0); + }} + placeholder={t("oAuthDevicePollingInterval")} + /> + )} /> - )} - /> - - - } - > - - + + + } + > + + + + )} openidConfigOverride, boolean includeClientScopes) { DEFAULT_GRANT_TYPES_SUPPORTED = Stream.of(OAuth2Constants.AUTHORIZATION_CODE, OAuth2Constants.IMPLICIT, OAuth2Constants.REFRESH_TOKEN, OAuth2Constants.PASSWORD, OAuth2Constants.CLIENT_CREDENTIALS, - OAuth2Constants.DEVICE_CODE_GRANT_TYPE, OAuth2Constants.CIBA_GRANT_TYPE).collect(Collectors.toList()); if (Profile.isFeatureEnabled(Profile.Feature.TOKEN_EXCHANGE)) { DEFAULT_GRANT_TYPES_SUPPORTED.add(OAuth2Constants.TOKEN_EXCHANGE_GRANT_TYPE); } + + if (Profile.isFeatureEnabled(Profile.Feature.DEVICE_FLOW)) { + DEFAULT_GRANT_TYPES_SUPPORTED.add(OAuth2Constants.DEVICE_CODE_GRANT_TYPE); + } + this.session = session; this.openidConfigOverride = openidConfigOverride; this.includeClientScopes = includeClientScopes; @@ -127,9 +131,11 @@ public Object getConfig() { config.setIntrospectionEndpoint(backendUriBuilder.clone().path(OIDCLoginProtocolService.class, "token").path(TokenEndpoint.class, "introspect").build(realm.getName(), OIDCLoginProtocol.LOGIN_PROTOCOL).toString()); config.setUserinfoEndpoint(backendUriBuilder.clone().path(OIDCLoginProtocolService.class, "issueUserInfo").build(realm.getName(), OIDCLoginProtocol.LOGIN_PROTOCOL).toString()); config.setLogoutEndpoint(frontendUriBuilder.clone().path(OIDCLoginProtocolService.class, "logout").build(realm.getName(), OIDCLoginProtocol.LOGIN_PROTOCOL).toString()); - config.setDeviceAuthorizationEndpoint(frontendUriBuilder.clone().path(OIDCLoginProtocolService.class, "auth") - .path(AuthorizationEndpoint.class, "authorizeDevice").path(DeviceEndpoint.class, "handleDeviceRequest") - .build(realm.getName(), OIDCLoginProtocol.LOGIN_PROTOCOL).toString()); + if (Profile.isFeatureEnabled(Profile.Feature.DEVICE_FLOW)) { + config.setDeviceAuthorizationEndpoint(frontendUriBuilder.clone().path(OIDCLoginProtocolService.class, "auth") + .path(AuthorizationEndpoint.class, "authorizeDevice").path(DeviceEndpoint.class, "handleDeviceRequest") + .build(realm.getName(), OIDCLoginProtocol.LOGIN_PROTOCOL).toString()); + } URI jwksUri = backendUriBuilder.clone().path(OIDCLoginProtocolService.class, "certs").build(realm.getName(), OIDCLoginProtocol.LOGIN_PROTOCOL); @@ -301,7 +307,9 @@ protected MTLSEndpointAliases getMtlsEndpointAliases(OIDCConfigurationRepresenta mtls_endpoints.setTokenEndpoint(config.getTokenEndpoint()); mtls_endpoints.setRevocationEndpoint(config.getRevocationEndpoint()); mtls_endpoints.setIntrospectionEndpoint(config.getIntrospectionEndpoint()); - mtls_endpoints.setDeviceAuthorizationEndpoint(config.getDeviceAuthorizationEndpoint()); + if (Profile.isFeatureEnabled(Profile.Feature.DEVICE_FLOW)) { + mtls_endpoints.setDeviceAuthorizationEndpoint(config.getDeviceAuthorizationEndpoint()); + } mtls_endpoints.setRegistrationEndpoint(config.getRegistrationEndpoint()); mtls_endpoints.setUserInfoEndpoint(config.getUserinfoEndpoint()); mtls_endpoints.setBackchannelAuthenticationEndpoint(config.getBackchannelAuthenticationEndpoint()); diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java index 2c195fd32443..ea46dbf66151 100755 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/AuthorizationEndpoint.java @@ -125,6 +125,9 @@ public Response buildGet() { */ @Path("device") public Object authorizeDevice() { + if (!Profile.isFeatureEnabled(Profile.Feature.DEVICE_FLOW)) { + return null; + } return new DeviceEndpoint(session, event); } diff --git a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/TokenEndpoint.java b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/TokenEndpoint.java index 059e11477bea..c1d717da2454 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/endpoints/TokenEndpoint.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/endpoints/TokenEndpoint.java @@ -309,19 +309,26 @@ private void checkGrantType() { event.event(EventType.PERMISSION_TOKEN); action = Action.PERMISSION; } else if (grantType.equals(OAuth2Constants.DEVICE_CODE_GRANT_TYPE)) { + if (!Profile.isFeatureEnabled(Profile.Feature.DEVICE_FLOW)) { + throw newUnsupportedGrantTypeException(); + } event.event(EventType.OAUTH2_DEVICE_CODE_TO_TOKEN); action = Action.OAUTH2_DEVICE_CODE; } else if (grantType.equals(OAuth2Constants.CIBA_GRANT_TYPE)) { event.event(EventType.AUTHREQID_TO_TOKEN); action = Action.CIBA; } else { - throw new CorsErrorResponseException(cors, OAuthErrorException.UNSUPPORTED_GRANT_TYPE, - "Unsupported " + OIDCLoginProtocol.GRANT_TYPE_PARAM, Response.Status.BAD_REQUEST); + throw newUnsupportedGrantTypeException(); } event.detail(Details.GRANT_TYPE, grantType); } + private CorsErrorResponseException newUnsupportedGrantTypeException() { + return new CorsErrorResponseException(cors, OAuthErrorException.UNSUPPORTED_GRANT_TYPE, + "Unsupported " + OIDCLoginProtocol.GRANT_TYPE_PARAM, Status.BAD_REQUEST); + } + private void checkParameterDuplicated() { for (String key : formParams.keySet()) { if (formParams.get(key).size() != 1) { diff --git a/services/src/main/java/org/keycloak/protocol/oidc/grants/device/endpoints/DeviceEndpointFactory.java b/services/src/main/java/org/keycloak/protocol/oidc/grants/device/endpoints/DeviceEndpointFactory.java index 0af1f6c80121..83b92d0d2073 100644 --- a/services/src/main/java/org/keycloak/protocol/oidc/grants/device/endpoints/DeviceEndpointFactory.java +++ b/services/src/main/java/org/keycloak/protocol/oidc/grants/device/endpoints/DeviceEndpointFactory.java @@ -20,18 +20,20 @@ package org.keycloak.protocol.oidc.grants.device.endpoints; import org.keycloak.Config; +import org.keycloak.common.Profile; import org.keycloak.events.EventBuilder; import org.keycloak.models.KeycloakContext; import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.models.RealmModel; +import org.keycloak.provider.EnvironmentDependentProviderFactory; import org.keycloak.services.resource.RealmResourceProvider; import org.keycloak.services.resource.RealmResourceProviderFactory; /** * @author Pedro Igor */ -public class DeviceEndpointFactory implements RealmResourceProviderFactory { +public class DeviceEndpointFactory implements RealmResourceProviderFactory, EnvironmentDependentProviderFactory { @Override public RealmResourceProvider create(KeycloakSession session) { @@ -60,4 +62,9 @@ public void close() { public String getId() { return "device"; } + + @Override + public boolean isSupported() { + return Profile.isFeatureEnabled(Profile.Feature.DEVICE_FLOW); + } } \ No newline at end of file From f9d6316e2ae02d6c2f14cf1c38c459aef7cd13d1 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Wed, 11 Oct 2023 21:02:20 +0200 Subject: [PATCH 02/11] Honor device flow feature in client capability config in admin ui --- .../src/clients/add/CapabilityConfig.tsx | 54 ++++++++++--------- 1 file changed, 29 insertions(+), 25 deletions(-) diff --git a/js/apps/admin-ui/src/clients/add/CapabilityConfig.tsx b/js/apps/admin-ui/src/clients/add/CapabilityConfig.tsx index c91c512b03ee..936de3224ac5 100644 --- a/js/apps/admin-ui/src/clients/add/CapabilityConfig.tsx +++ b/js/apps/admin-ui/src/clients/add/CapabilityConfig.tsx @@ -14,6 +14,7 @@ import { FormAccess } from "../../components/form/FormAccess"; import { HelpItem } from "ui-shared"; import { convertAttributeNameToForm } from "../../util"; import { FormFields } from "../ClientDetails"; +import useIsFeatureEnabled, { Feature } from "../../utils/useIsFeatureEnabled"; type CapabilityConfigProps = { unWrap?: boolean; @@ -29,6 +30,7 @@ export const CapabilityConfig = ({ const protocol = type || watch("protocol"); const clientAuthentication = watch("publicClient"); const authorization = watch("authorizationServicesEnabled"); + const isFeatureEnabled = useIsFeatureEnabled(); return ( - - - >("attributes.oauth2.device.authorization.grant.enabled")} - defaultValue={false} - control={control} - render={({ field }) => ( - - - - - )} - /> - + {isFeatureEnabled(Feature.DeviceFlow) && ( + + + >("attributes.oauth2.device.authorization.grant.enabled")} + defaultValue={false} + control={control} + render={({ field }) => ( + + + + + )} + /> + + )} ( From 1af17ccf3a35f0ac75b21038129abc5198d25575 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Mon, 16 Oct 2023 13:44:37 +0200 Subject: [PATCH 03/11] Revise Profile based on code review --- common/src/main/java/org/keycloak/common/Profile.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/common/src/main/java/org/keycloak/common/Profile.java b/common/src/main/java/org/keycloak/common/Profile.java index 71e36b48ec36..d117bb3c8920 100755 --- a/common/src/main/java/org/keycloak/common/Profile.java +++ b/common/src/main/java/org/keycloak/common/Profile.java @@ -95,8 +95,6 @@ public enum Feature { LINKEDIN_OAUTH("LinkedIn Social Identity Provider based on OAuth", Type.DEPRECATED), DEVICE_FLOW("OAuth 2.0 Device Authorization Grant", Type.DEFAULT), - - // Add new Feature above this line ; private final Type type; From 66560b64e721904ef1b4cb2191bc7c0d10572503 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Tue, 17 Oct 2023 20:44:24 +0200 Subject: [PATCH 04/11] Add tests for oauth device grant flow feature disabled (#23892) --- .../OAuth2DeviceAuthorizationGrantTest.java | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java index bcc8fa941149..d69e02a481db 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java @@ -27,14 +27,17 @@ import org.junit.Rule; import org.junit.Test; import org.keycloak.OAuth2Constants; +import org.keycloak.OAuthErrorException; import org.keycloak.admin.client.resource.ClientResource; import org.keycloak.admin.client.resource.RealmResource; +import org.keycloak.common.Profile; import org.keycloak.events.Errors; import org.keycloak.models.ClientScopeModel; import org.keycloak.models.OAuth2DeviceConfig; import org.keycloak.models.utils.KeycloakModelUtils; import org.keycloak.protocol.oidc.OIDCConfigAttributes; import org.keycloak.protocol.oidc.grants.device.endpoints.DeviceEndpoint; +import org.keycloak.protocol.oidc.representations.OIDCConfigurationRepresentation; import org.keycloak.representations.AccessToken; import org.keycloak.representations.UserInfo; import org.keycloak.representations.idm.ClientRepresentation; @@ -44,6 +47,8 @@ import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.AssertEvents; import org.keycloak.testsuite.admin.ApiUtil; +import org.keycloak.testsuite.arquillian.annotation.DisableFeature; +import org.keycloak.testsuite.arquillian.annotation.EnableFeature; import org.keycloak.testsuite.oidc.PkceGenerator; import org.keycloak.testsuite.pages.ErrorPage; import org.keycloak.testsuite.pages.OAuth2DeviceVerificationPage; @@ -992,6 +997,32 @@ public void testClientWithErrors() throws Exception { } } + @Test + @EnableFeature(value = Profile.Feature.DEVICE_FLOW, skipRestart = true) + public void ensureDeviceFlowConfigNotPresentWhenDeviceFlowEnabled() { + + OIDCConfigurationRepresentation oidcConfigRep = oauth.doWellKnownRequest(REALM_NAME); + Assert.assertNotNull("deviceAuthorizationEndpoint should be not null", oidcConfigRep.getDeviceAuthorizationEndpoint()); + Assert.assertNotNull("mtlsEndpointAliases.deviceAuthorizationEndpoint should be not null", oidcConfigRep.getMtlsEndpointAliases().getDeviceAuthorizationEndpoint()); + } + + @Test + @DisableFeature(value = Profile.Feature.DEVICE_FLOW, skipRestart = true) + public void ensureDeviceFlowConfigNotPresentWhenDeviceFlowDisabled() throws Exception { + + OIDCConfigurationRepresentation oidcConfigRep = oauth.doWellKnownRequest(REALM_NAME); + Assert.assertNull("deviceAuthorizationEndpoint should be null", oidcConfigRep.getDeviceAuthorizationEndpoint()); + Assert.assertNull("mtlsEndpointAliases.deviceAuthorizationEndpoint should be null", oidcConfigRep.getMtlsEndpointAliases().getDeviceAuthorizationEndpoint()); + + oauth.realm(REALM_NAME); + oauth.clientId(DEVICE_APP_PUBLIC); + OAuthClient.DeviceAuthorizationResponse response = doDeviceAuthorizationWithDuplicatedParams(DEVICE_APP_PUBLIC, null); + Assert.assertEquals(404, response.getStatusCode()); + + OAuthClient.AccessTokenResponse tokenResponse = oauth.doDeviceTokenRequest(DEVICE_APP_PUBLIC, null, "dummy"); + Assert.assertEquals(OAuthErrorException.UNSUPPORTED_GRANT_TYPE, tokenResponse.getError()); + } + private void openVerificationPage(String verificationUri) { driver.navigate().to(verificationUri); } From d427b734794058d4eb37220530f69d8b710e6852 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Tue, 17 Oct 2023 22:27:55 +0200 Subject: [PATCH 05/11] Revise tests for disabled device flow --- .../oauth/OAuth2DeviceAuthorizationGrantTest.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java index d69e02a481db..a64853d15640 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java @@ -22,6 +22,7 @@ import static org.keycloak.models.OAuth2DeviceConfig.DEFAULT_OAUTH2_DEVICE_CODE_LIFESPAN; import static org.keycloak.models.OAuth2DeviceConfig.DEFAULT_OAUTH2_DEVICE_POLLING_INTERVAL; +import org.apache.http.client.methods.HttpGet; import org.jboss.arquillian.graphene.page.Page; import org.junit.Before; import org.junit.Rule; @@ -1014,11 +1015,14 @@ public void ensureDeviceFlowConfigNotPresentWhenDeviceFlowDisabled() throws Exce Assert.assertNull("deviceAuthorizationEndpoint should be null", oidcConfigRep.getDeviceAuthorizationEndpoint()); Assert.assertNull("mtlsEndpointAliases.deviceAuthorizationEndpoint should be null", oidcConfigRep.getMtlsEndpointAliases().getDeviceAuthorizationEndpoint()); + try (var httpClient = oauth.getHttpClient().get()) { + Assert.assertEquals("Should return not found for device auth endpoint" + , (long) 404 + , (long) httpClient.execute(new HttpGet(oauth.getDeviceAuthorizationUrl()), r -> r.getStatusLine().getStatusCode())); + } + oauth.realm(REALM_NAME); oauth.clientId(DEVICE_APP_PUBLIC); - OAuthClient.DeviceAuthorizationResponse response = doDeviceAuthorizationWithDuplicatedParams(DEVICE_APP_PUBLIC, null); - Assert.assertEquals(404, response.getStatusCode()); - OAuthClient.AccessTokenResponse tokenResponse = oauth.doDeviceTokenRequest(DEVICE_APP_PUBLIC, null, "dummy"); Assert.assertEquals(OAuthErrorException.UNSUPPORTED_GRANT_TYPE, tokenResponse.getError()); } From 1bdcfc5ff8a3e8ee66a863c3d591d1470f92a643 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Wed, 18 Oct 2023 22:25:25 +0200 Subject: [PATCH 06/11] Add device-flow flag to approved help output references Signed-off-by: Thomas Darimont --- .../HelpCommandDistTest.testBuildHelp.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testBuildHelp.windows.approved.txt | 6 +++--- .../HelpCommandDistTest.testExportHelp.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testExportHelpAll.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testImportHelp.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testImportHelpAll.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testStartDevHelp.unix.approved.txt | 6 +++--- ...elpCommandDistTest.testStartDevHelp.windows.approved.txt | 6 +++--- ...elpCommandDistTest.testStartDevHelpAll.unix.approved.txt | 6 +++--- ...CommandDistTest.testStartDevHelpAll.windows.approved.txt | 6 +++--- .../HelpCommandDistTest.testStartHelp.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testStartHelp.windows.approved.txt | 6 +++--- .../HelpCommandDistTest.testStartHelpAll.unix.approved.txt | 6 +++--- ...elpCommandDistTest.testStartHelpAll.windows.approved.txt | 6 +++--- 14 files changed, 42 insertions(+), 42 deletions(-) diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.unix.approved.txt index b5af1a0423d9..8fb8d26f91db 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.unix.approved.txt @@ -47,9 +47,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.windows.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.windows.approved.txt index 4e37256ddfbc..9edfa5afe922 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.windows.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.windows.approved.txt @@ -47,9 +47,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.unix.approved.txt index 92813778bbfd..7d76988b6e2a 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.unix.approved.txt @@ -58,9 +58,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.unix.approved.txt index 3cee62a54de8..aeb75c943d6d 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.unix.approved.txt @@ -121,9 +121,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.unix.approved.txt index eb7672e0788d..c9fa43febd30 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.unix.approved.txt @@ -58,9 +58,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.unix.approved.txt index 8916753a6536..c2c59b1c4a02 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.unix.approved.txt @@ -121,9 +121,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.unix.approved.txt index b8460e04b337..40287e9be8fb 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.unix.approved.txt @@ -74,9 +74,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.windows.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.windows.approved.txt index fa2ed54f6003..7bdddac4e071 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.windows.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.windows.approved.txt @@ -72,9 +72,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.unix.approved.txt index cf00c3b44d90..37e97a0caf88 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.unix.approved.txt @@ -137,9 +137,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.windows.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.windows.approved.txt index 6683b5544172..f1c4fd059361 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.windows.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.windows.approved.txt @@ -135,9 +135,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.unix.approved.txt index 768ca51d90d6..e6e9f19df54f 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.unix.approved.txt @@ -75,9 +75,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.windows.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.windows.approved.txt index c3d6506c7060..9e73213d20ed 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.windows.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.windows.approved.txt @@ -73,9 +73,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.unix.approved.txt index 05a47a6fa769..49bfc717f107 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.unix.approved.txt @@ -138,9 +138,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.windows.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.windows.approved.txt index 82137684eefc..7d106fde0b41 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.windows.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.windows.approved.txt @@ -136,9 +136,9 @@ Feature: --features Enables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. --features-disabled Disables a set of one or more features. Possible values are: account-api, From c1a9639d0ac24a17dfc61b8dfc06005cd80fb7bc Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Thu, 19 Oct 2023 22:26:48 +0200 Subject: [PATCH 07/11] Revise approved help output tests for disabled device flow --- .../HelpCommandDistTest.testBuildHelp.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testBuildHelp.windows.approved.txt | 6 +++--- .../HelpCommandDistTest.testExportHelp.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testExportHelpAll.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testImportHelp.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testImportHelpAll.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testStartDevHelp.unix.approved.txt | 6 +++--- ...elpCommandDistTest.testStartDevHelp.windows.approved.txt | 6 +++--- ...elpCommandDistTest.testStartDevHelpAll.unix.approved.txt | 6 +++--- ...CommandDistTest.testStartDevHelpAll.windows.approved.txt | 6 +++--- .../HelpCommandDistTest.testStartHelp.unix.approved.txt | 6 +++--- .../HelpCommandDistTest.testStartHelp.windows.approved.txt | 6 +++--- .../HelpCommandDistTest.testStartHelpAll.unix.approved.txt | 6 +++--- ...elpCommandDistTest.testStartHelpAll.windows.approved.txt | 6 +++--- 14 files changed, 42 insertions(+), 42 deletions(-) diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.unix.approved.txt index 8fb8d26f91db..8b1ddade2603 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.unix.approved.txt @@ -55,9 +55,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. HTTP/TLS: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.windows.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.windows.approved.txt index 9edfa5afe922..9f4fbf153099 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.windows.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testBuildHelp.windows.approved.txt @@ -55,9 +55,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. HTTP/TLS: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.unix.approved.txt index 7d76988b6e2a..c2d57adfb40a 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelp.unix.approved.txt @@ -66,9 +66,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Config: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.unix.approved.txt index aeb75c943d6d..a1e80f572163 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testExportHelpAll.unix.approved.txt @@ -129,9 +129,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Config: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.unix.approved.txt index c9fa43febd30..3b62ae642047 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelp.unix.approved.txt @@ -66,9 +66,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Config: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.unix.approved.txt index c2c59b1c4a02..5140fcb9dce7 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testImportHelpAll.unix.approved.txt @@ -129,9 +129,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Config: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.unix.approved.txt index 40287e9be8fb..c47b41a2deb9 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.unix.approved.txt @@ -82,9 +82,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Hostname: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.windows.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.windows.approved.txt index 7bdddac4e071..a73923a126f3 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.windows.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelp.windows.approved.txt @@ -80,9 +80,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Hostname: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.unix.approved.txt index 37e97a0caf88..e4bcdc09b5f2 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.unix.approved.txt @@ -145,9 +145,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Hostname: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.windows.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.windows.approved.txt index f1c4fd059361..a3e4530e792b 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.windows.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartDevHelpAll.windows.approved.txt @@ -143,9 +143,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Hostname: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.unix.approved.txt index e6e9f19df54f..bd0feb7e0fdf 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.unix.approved.txt @@ -83,9 +83,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Hostname: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.windows.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.windows.approved.txt index 9e73213d20ed..1080c0f77912 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.windows.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelp.windows.approved.txt @@ -81,9 +81,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Hostname: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.unix.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.unix.approved.txt index 49bfc717f107..7d9681d0eb09 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.unix.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.unix.approved.txt @@ -146,9 +146,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Hostname: diff --git a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.windows.approved.txt b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.windows.approved.txt index 7d106fde0b41..7b08eb29520f 100644 --- a/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.windows.approved.txt +++ b/quarkus/tests/integration/src/test/resources/org/keycloak/it/cli/dist/approvals/cli/help/HelpCommandDistTest.testStartHelpAll.windows.approved.txt @@ -144,9 +144,9 @@ Feature: Disables a set of one or more features. Possible values are: account-api, account2, account3, admin-api, admin-fine-grained-authz, admin2, authorization, ciba, client-policies, client-secret-rotation, - declarative-user-profile, docker, dpop, dynamic-scopes, fips, impersonation, - js-adapter, kerberos, linkedin-oauth, map-storage, par, preview, - recovery-codes, scripts, step-up-authentication, token-exchange, + declarative-user-profile, device-flow, docker, dpop, dynamic-scopes, fips, + impersonation, js-adapter, kerberos, linkedin-oauth, map-storage, par, + preview, recovery-codes, scripts, step-up-authentication, token-exchange, update-email, web-authn. Hostname: From 25ab908eb4e50141f8d0f255f289f6bbbb2b12ae Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Thu, 19 Oct 2023 23:31:14 +0200 Subject: [PATCH 08/11] Revise test method name Signed-off-by: Thomas Darimont --- .../testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java index a64853d15640..debdd5ff1cf8 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java @@ -1000,7 +1000,7 @@ public void testClientWithErrors() throws Exception { @Test @EnableFeature(value = Profile.Feature.DEVICE_FLOW, skipRestart = true) - public void ensureDeviceFlowConfigNotPresentWhenDeviceFlowEnabled() { + public void ensureDeviceFlowConfigPresentWhenDeviceFlowEnabled() { OIDCConfigurationRepresentation oidcConfigRep = oauth.doWellKnownRequest(REALM_NAME); Assert.assertNotNull("deviceAuthorizationEndpoint should be not null", oidcConfigRep.getDeviceAuthorizationEndpoint()); From 64ac80c129599ed51f8aa4c1363f70234c08ab8d Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Mon, 23 Oct 2023 15:48:45 +0200 Subject: [PATCH 09/11] Activate device_flow feature by default for OAuth2DeviceAuthorizationGrantTest --- .../testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java index debdd5ff1cf8..d415ed24d013 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java @@ -77,6 +77,7 @@ /** * @author Hiroyuki Wada */ +@EnableFeature(value = Profile.Feature.DEVICE_FLOW, skipRestart = true) public class OAuth2DeviceAuthorizationGrantTest extends AbstractKeycloakTest { private static String userId; @@ -999,7 +1000,6 @@ public void testClientWithErrors() throws Exception { } @Test - @EnableFeature(value = Profile.Feature.DEVICE_FLOW, skipRestart = true) public void ensureDeviceFlowConfigPresentWhenDeviceFlowEnabled() { OIDCConfigurationRepresentation oidcConfigRep = oauth.doWellKnownRequest(REALM_NAME); From 621df83c3f4ad15b2c331b6a04f752d913675115 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Mon, 23 Oct 2023 15:49:24 +0200 Subject: [PATCH 10/11] Fix typo in TestingResourceProvider#enableFeature --- .../keycloak/testsuite/client/KeycloakTestingClient.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java index eb0fc218383f..ad75efba3a4c 100755 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java @@ -79,9 +79,9 @@ public TestingResource testing(String realm) { } public void enableFeature(Profile.Feature feature) { - Set disabledFeatures = testing().enableFeature(feature.toString()); - Assert.assertFalse(disabledFeatures.contains(feature)); - ProfileAssume.updateDisabledFeatures(disabledFeatures); + Set enabledFeatures = testing().enableFeature(feature.toString()); + Assert.assertFalse(enabledFeatures.contains(feature)); + ProfileAssume.updateDisabledFeatures(enabledFeatures); } public void disableFeature(Profile.Feature feature) { From 5841a1f9ed6624f09b6d481fa9d75699df41ae3e Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Mon, 23 Oct 2023 22:26:45 +0200 Subject: [PATCH 11/11] Workaround non working feature toggle with -Pauth-server-quarkus For some reason @DisableFeature is not considered when executed with -Pauth-server-quarkus. Current workaround is to ignore exceptions during -Pauth-server-quarkus. --- .../rest/TestingResourceProvider.java | 47 ++++++++++++++++++- .../client/KeycloakTestingClient.java | 9 ++++ .../client/resources/TestingResource.java | 10 ++++ .../OAuth2DeviceAuthorizationGrantTest.java | 45 ++++++++++-------- 4 files changed, 91 insertions(+), 20 deletions(-) diff --git a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java index 1710c16eaebc..e1c4395bf21b 100644 --- a/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java +++ b/testsuite/integration-arquillian/servers/auth-server/services/testsuite-providers/src/main/java/org/keycloak/testsuite/rest/TestingResourceProvider.java @@ -113,8 +113,11 @@ import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.nio.file.Files; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Collections; @@ -124,6 +127,7 @@ import java.util.Map; import java.util.Properties; import java.util.Set; +import java.util.function.Consumer; import java.util.stream.Collectors; import java.util.stream.Stream; import java.util.UUID; @@ -881,6 +885,19 @@ public TestJavascriptResource getJavascriptResource() { } private void setFeatureInProfileFile(File file, Profile.Feature featureProfile, String newState) { + doWithProperties(file, props -> { + props.setProperty("feature." + featureProfile.toString().toLowerCase(), newState); + }); + } + + private void unsetFeatureInProfileFile(File file, Profile.Feature featureProfile) { + doWithProperties(file, props -> { + props.remove("feature." + featureProfile.toString().toLowerCase()); + }); + } + + private void doWithProperties(File file, Consumer callback) { + Properties properties = new Properties(); if (file.isFile() && file.exists()) { try (FileInputStream fis = new FileInputStream(file)) { @@ -890,7 +907,11 @@ private void setFeatureInProfileFile(File file, Profile.Feature featureProfile, } } - properties.setProperty("feature." + featureProfile.toString().toLowerCase(), newState); + callback.accept(properties); + + if (file.isFile() && !file.getParentFile().exists()) { + file.getParentFile().mkdirs(); + } try (FileOutputStream fos = new FileOutputStream(file)) { properties.store(fos, null); @@ -922,6 +943,30 @@ public Set disableFeature(@PathParam("feature") String feature) return updateFeature(feature, false); } + @POST + @Path("/reset-feature/{feature}") + @Consumes(MediaType.APPLICATION_JSON) + public void resetFeature(@PathParam("feature") String featureKey) { + + Profile.Feature feature; + + try { + feature = Profile.Feature.valueOf(featureKey); + } catch (IllegalArgumentException e) { + System.err.printf("Feature '%s' doesn't exist!!\n", featureKey); + throw new BadRequestException(); + } + + FeatureDeployerUtil.initBeforeChangeFeature(feature); + + String jbossServerConfigDir = System.getProperty("jboss.server.config.dir"); + // If we are in jboss-based container, we need to write profile.properties file, otherwise the change in system property will disappear after restart + if (jbossServerConfigDir != null) { + File file = new File(jbossServerConfigDir, "profile.properties"); + unsetFeatureInProfileFile(file, feature); + } + } + private Set updateFeature(String featureKey, boolean shouldEnable) { Profile.Feature feature; diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java index ad75efba3a4c..b93a3d309435 100755 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/KeycloakTestingClient.java @@ -90,6 +90,15 @@ public void disableFeature(Profile.Feature feature) { ProfileAssume.updateDisabledFeatures(disabledFeatures); } + /** + * Resets the feature to it's default setting. + * + * @param feature + */ + public void resetFeature(Profile.Feature feature) { + testing().resetFeature(feature.toString()); + } + public TestApplicationResource testApp() { return target.proxy(TestApplicationResource.class); } public TestSamlApplicationResource testSamlApp() { return target.proxy(TestSamlApplicationResource.class); } diff --git a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingResource.java b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingResource.java index 70da333d0c9a..96455a69dcf1 100644 --- a/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingResource.java +++ b/testsuite/integration-arquillian/tests/base/src/main/java/org/keycloak/testsuite/client/resources/TestingResource.java @@ -343,6 +343,16 @@ String runModelTestOnServer(@QueryParam("testClassName") String testClassName, @Produces(MediaType.APPLICATION_JSON) Set disableFeature(@PathParam("feature") String feature); + /** + * Resets the given feature to it's default state. + * + * @param feature + */ + @POST + @Path("/reset-feature/{feature}") + @Consumes(MediaType.APPLICATION_JSON) + void resetFeature(@PathParam("feature") String feature); + /** * If property-value is null, the system property will be unset (removed) on the server */ diff --git a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java index d415ed24d013..f5622788fba7 100644 --- a/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java +++ b/testsuite/integration-arquillian/tests/base/src/test/java/org/keycloak/testsuite/oauth/OAuth2DeviceAuthorizationGrantTest.java @@ -48,13 +48,12 @@ import org.keycloak.testsuite.Assert; import org.keycloak.testsuite.AssertEvents; import org.keycloak.testsuite.admin.ApiUtil; -import org.keycloak.testsuite.arquillian.annotation.DisableFeature; -import org.keycloak.testsuite.arquillian.annotation.EnableFeature; import org.keycloak.testsuite.oidc.PkceGenerator; import org.keycloak.testsuite.pages.ErrorPage; import org.keycloak.testsuite.pages.OAuth2DeviceVerificationPage; import org.keycloak.testsuite.pages.OAuthGrantPage; import org.keycloak.testsuite.util.ClientBuilder; +import org.keycloak.testsuite.util.ContainerAssume; import org.keycloak.testsuite.util.OAuthClient; import org.keycloak.testsuite.util.RealmBuilder; import org.keycloak.testsuite.util.UserBuilder; @@ -68,16 +67,15 @@ import org.keycloak.util.BasicAuthHelper; import org.openqa.selenium.Cookie; +import java.io.IOException; import java.util.List; import java.util.LinkedList; import java.io.UnsupportedEncodingException; -import java.util.concurrent.TimeUnit; /** * @author Hiroyuki Wada */ -@EnableFeature(value = Profile.Feature.DEVICE_FLOW, skipRestart = true) public class OAuth2DeviceAuthorizationGrantTest extends AbstractKeycloakTest { private static String userId; @@ -1000,7 +998,7 @@ public void testClientWithErrors() throws Exception { } @Test - public void ensureDeviceFlowConfigPresentWhenDeviceFlowEnabled() { + public void ensureDeviceFlowConfigPresentWhenDeviceFlowIsEnabled() { OIDCConfigurationRepresentation oidcConfigRep = oauth.doWellKnownRequest(REALM_NAME); Assert.assertNotNull("deviceAuthorizationEndpoint should be not null", oidcConfigRep.getDeviceAuthorizationEndpoint()); @@ -1008,23 +1006,32 @@ public void ensureDeviceFlowConfigPresentWhenDeviceFlowEnabled() { } @Test - @DisableFeature(value = Profile.Feature.DEVICE_FLOW, skipRestart = true) - public void ensureDeviceFlowConfigNotPresentWhenDeviceFlowDisabled() throws Exception { + // @DisableFeature(value = Profile.Feature.DEVICE_FLOW, executeAsLast = false, skipRestart = true) + public void ensureDeviceFlowConfigNotPresentWhenDeviceFlowIsDisabled() throws Exception { - OIDCConfigurationRepresentation oidcConfigRep = oauth.doWellKnownRequest(REALM_NAME); - Assert.assertNull("deviceAuthorizationEndpoint should be null", oidcConfigRep.getDeviceAuthorizationEndpoint()); - Assert.assertNull("mtlsEndpointAliases.deviceAuthorizationEndpoint should be null", oidcConfigRep.getMtlsEndpointAliases().getDeviceAuthorizationEndpoint()); + // this test currently does not work with -Pauth-server-quarkus + ContainerAssume.assumeAuthServerUndertow(); - try (var httpClient = oauth.getHttpClient().get()) { - Assert.assertEquals("Should return not found for device auth endpoint" - , (long) 404 - , (long) httpClient.execute(new HttpGet(oauth.getDeviceAuthorizationUrl()), r -> r.getStatusLine().getStatusCode())); - } + testingClient.disableFeature(Profile.Feature.DEVICE_FLOW); - oauth.realm(REALM_NAME); - oauth.clientId(DEVICE_APP_PUBLIC); - OAuthClient.AccessTokenResponse tokenResponse = oauth.doDeviceTokenRequest(DEVICE_APP_PUBLIC, null, "dummy"); - Assert.assertEquals(OAuthErrorException.UNSUPPORTED_GRANT_TYPE, tokenResponse.getError()); + try { + OIDCConfigurationRepresentation oidcConfigRep = oauth.doWellKnownRequest(REALM_NAME); + Assert.assertNull("deviceAuthorizationEndpoint should be null", oidcConfigRep.getDeviceAuthorizationEndpoint()); + Assert.assertNull("mtlsEndpointAliases.deviceAuthorizationEndpoint should be null", oidcConfigRep.getMtlsEndpointAliases().getDeviceAuthorizationEndpoint()); + + try (var httpClient = oauth.getHttpClient().get()) { + Assert.assertEquals("Should return not found for device auth endpoint" + , (long) 404 + , (long) httpClient.execute(new HttpGet(oauth.getDeviceAuthorizationUrl()), r -> r.getStatusLine().getStatusCode())); + } + + oauth.realm(REALM_NAME); + oauth.clientId(DEVICE_APP_PUBLIC); + OAuthClient.AccessTokenResponse tokenResponse = oauth.doDeviceTokenRequest(DEVICE_APP_PUBLIC, null, "dummy"); + Assert.assertEquals(OAuthErrorException.UNSUPPORTED_GRANT_TYPE, tokenResponse.getError()); + } finally { + testingClient.resetFeature(Profile.Feature.DEVICE_FLOW); + } } private void openVerificationPage(String verificationUri) {