From acd00a492b990625fbfca95c1dd117bdd6e398ec Mon Sep 17 00:00:00 2001 From: mposolda Date: Fri, 15 Oct 2021 09:40:30 +0200 Subject: [PATCH] KEYCLOAK-19556 Avoid auto-creating invalid redirect URL for FAPI clients --- .../executor/SecureClientUrisExecutor.java | 9 ++++++++- .../java/org/keycloak/testsuite/client/FAPI1Test.java | 10 ++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/services/clientpolicy/executor/SecureClientUrisExecutor.java b/services/src/main/java/org/keycloak/services/clientpolicy/executor/SecureClientUrisExecutor.java index 5ea44c5776..f0214f95d0 100644 --- a/services/src/main/java/org/keycloak/services/clientpolicy/executor/SecureClientUrisExecutor.java +++ b/services/src/main/java/org/keycloak/services/clientpolicy/executor/SecureClientUrisExecutor.java @@ -62,7 +62,14 @@ public class SecureClientUrisExecutor implements ClientPolicyExecutorProvider { + clientRep.setRootUrl("https://hostname2.com"); + clientRep.setRedirectUris(null); + }); + ClientRepresentation client2 = getClientByAdmin(clientUUID2); + Assert.assertNames(client2.getRedirectUris(), "https://hostname2.com"); + getCleanup().addClientUuid(clientUUID2); }