diff --git a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/account/KeycloakRole.java b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/account/KeycloakRole.java index 82efff1b86..f83549deb9 100644 --- a/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/account/KeycloakRole.java +++ b/adapters/oidc/spring-security/src/main/java/org/keycloak/adapters/springsecurity/account/KeycloakRole.java @@ -51,13 +51,13 @@ public class KeycloakRole implements GrantedAuthority { if (this == o) { return true; } - if (!(o instanceof KeycloakRole)) { + if (!(o instanceof GrantedAuthority)) { return false; } - KeycloakRole that = (KeycloakRole) o; + GrantedAuthority that = (GrantedAuthority) o; - if (!role.equals(that.role)) { + if (!role.equals(that.getAuthority())) { return false; }