KEYCLOAK-4018 Use kc.client.id instead of clientId

This commit is contained in:
Jonas Pettersson 2016-12-09 14:22:06 +01:00
parent b56e23eded
commit 5e660977aa
No known key found for this signature in database
GPG key ID: 1D3D970772EA56C9

View file

@ -18,11 +18,11 @@ public class ClientPolicyProvider implements PolicyProvider {
@Override @Override
public void evaluate(Evaluation evaluation) { public void evaluate(Evaluation evaluation) {
EvaluationContext context = evaluation.getContext(); EvaluationContext context = evaluation.getContext();
String[] clientIds = getClients(this.policy); String[] clients = getClients(this.policy);
if (clientIds.length > 0) { if (clients.length > 0) {
for (String clientId : clientIds) { for (String client : clients) {
if (context.getIdentity().getId().equals(clientId)) { if (context.getAttributes().containsValue("kc.client.id", client)) {
evaluation.grant(); evaluation.grant();
return; return;
} }