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:
parent
411ea331f6
commit
fe18e93ba4
3 changed files with 5 additions and 3 deletions
|
@ -32,6 +32,7 @@ import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import org.jboss.logging.Logger;
|
import org.jboss.logging.Logger;
|
||||||
|
import org.keycloak.Config;
|
||||||
import org.keycloak.OAuth2Constants;
|
import org.keycloak.OAuth2Constants;
|
||||||
import org.keycloak.authorization.AuthorizationProvider;
|
import org.keycloak.authorization.AuthorizationProvider;
|
||||||
import org.keycloak.authorization.AuthorizationProviderFactory;
|
import org.keycloak.authorization.AuthorizationProviderFactory;
|
||||||
|
@ -2634,7 +2635,8 @@ public class RepresentationToModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ResourceServer createResourceServer(ClientModel client, KeycloakSession session, boolean addDefaultRoles) {
|
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");
|
throw new RuntimeException("Only confidential clients are allowed to set authorization settings");
|
||||||
}
|
}
|
||||||
AuthorizationProvider authorization = session.getProvider(AuthorizationProvider.class);
|
AuthorizationProvider authorization = session.getProvider(AuthorizationProvider.class);
|
||||||
|
|
|
@ -27,7 +27,7 @@ client.webOrigins=
|
||||||
client.protocol=openid-connect
|
client.protocol=openid-connect
|
||||||
client.publicClient=<#if index % 3 == 0>true<#else>false</#if>
|
client.publicClient=<#if index % 3 == 0>true<#else>false</#if>
|
||||||
client.bearerOnly=<#if index % 3 == 1>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.serviceAccountsEnabled=${authorizationServicesEnabled?c}
|
||||||
|
|
||||||
# CLIENT ROLE
|
# CLIENT ROLE
|
||||||
|
|
|
@ -29,7 +29,7 @@ client.webOrigins=
|
||||||
client.protocol=openid-connect
|
client.protocol=openid-connect
|
||||||
client.publicClient=<#if index % 3 == 0>true<#else>false</#if>
|
client.publicClient=<#if index % 3 == 0>true<#else>false</#if>
|
||||||
client.bearerOnly=<#if index % 3 == 1>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.serviceAccountsEnabled=${authorizationServicesEnabled?c}
|
||||||
|
|
||||||
# CLIENT ROLE
|
# CLIENT ROLE
|
||||||
|
|
Loading…
Reference in a new issue