From 4e43518b2af2312e228d9caec998e3143bef8174 Mon Sep 17 00:00:00 2001 From: Pedro Igor Date: Wed, 26 Apr 2017 15:39:37 -0300 Subject: [PATCH] Checking realm role directly --- .../authorization/authorization/AuthorizationTokenService.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/src/main/java/org/keycloak/authorization/authorization/AuthorizationTokenService.java b/services/src/main/java/org/keycloak/authorization/authorization/AuthorizationTokenService.java index e60a0d6128..fb28054740 100644 --- a/services/src/main/java/org/keycloak/authorization/authorization/AuthorizationTokenService.java +++ b/services/src/main/java/org/keycloak/authorization/authorization/AuthorizationTokenService.java @@ -97,7 +97,7 @@ public class AuthorizationTokenService { KeycloakEvaluationContext evaluationContext = new KeycloakEvaluationContext(this.authorization.getKeycloakSession()); KeycloakIdentity identity = (KeycloakIdentity) evaluationContext.getIdentity(); - if (!identity.hasRole("uma_authorization")) { + if (!identity.hasRealmRole("uma_authorization")) { throw new ErrorResponseException(OAuthErrorException.INVALID_SCOPE, "Requires uma_authorization scope.", Status.FORBIDDEN); }