KEYCLOAK-10904 ExportImportTest unstable

- adding an exception for realm-management clients into the client confidentiality check
- fixing some performance test datasets to only enable authz for confidential clients
This commit is contained in:
Tomas Kyjovsky 2019-08-16 15:05:46 +02:00 committed by Pedro Igor
parent 411ea331f6
commit fe18e93ba4
3 changed files with 5 additions and 3 deletions

View file

@ -32,6 +32,7 @@ import java.util.function.Function;
import java.util.stream.Collectors;
import org.jboss.logging.Logger;
import org.keycloak.Config;
import org.keycloak.OAuth2Constants;
import org.keycloak.authorization.AuthorizationProvider;
import org.keycloak.authorization.AuthorizationProviderFactory;
@ -2634,7 +2635,8 @@ public class RepresentationToModel {
}
public static ResourceServer createResourceServer(ClientModel client, KeycloakSession session, boolean addDefaultRoles) {
if (client.isBearerOnly() || client.isPublicClient()) {
if ((client.isBearerOnly() || client.isPublicClient())
&& !(client.getClientId().equals(Config.getAdminRealm() + "-realm") || client.getClientId().equals(Constants.REALM_MANAGEMENT_CLIENT_ID))) {
throw new RuntimeException("Only confidential clients are allowed to set authorization settings");
}
AuthorizationProvider authorization = session.getProvider(AuthorizationProvider.class);

View file

@ -27,7 +27,7 @@ client.webOrigins=
client.protocol=openid-connect
client.publicClient=<#if index % 3 == 0>true<#else>false</#if>
client.bearerOnly=<#if index % 3 == 1>true<#else>false</#if>
client.authorizationServicesEnabled=${(!isPublicClient())?c}
client.authorizationServicesEnabled=${(!isPublicClient() && !isBearerOnly())?c}
client.serviceAccountsEnabled=${authorizationServicesEnabled?c}
# CLIENT ROLE

View file

@ -29,7 +29,7 @@ client.webOrigins=
client.protocol=openid-connect
client.publicClient=<#if index % 3 == 0>true<#else>false</#if>
client.bearerOnly=<#if index % 3 == 1>true<#else>false</#if>
client.authorizationServicesEnabled=${(!isPublicClient())?c}
client.authorizationServicesEnabled=${(!isPublicClient() && !isBearerOnly())?c}
client.serviceAccountsEnabled=${authorizationServicesEnabled?c}
# CLIENT ROLE