You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by co...@apache.org on 2018/09/24 14:59:10 UTC

[cxf-fediz] branch 1.4.x-fixes updated: Preserve empty role values when parsing the roles claim

This is an automated email from the ASF dual-hosted git repository.

coheigea pushed a commit to branch 1.4.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf-fediz.git


The following commit(s) were added to refs/heads/1.4.x-fixes by this push:
     new 5a74ba7  Preserve empty role values when parsing the roles claim
5a74ba7 is described below

commit 5a74ba7042cb489f7d19d7b35a104917eb0857a7
Author: Colm O hEigeartaigh <co...@apache.org>
AuthorDate: Mon Sep 24 10:58:35 2018 -0400

    Preserve empty role values when parsing the roles claim
---
 .../java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java     | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java b/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
index a93d019..d571680 100644
--- a/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
+++ b/plugins/core/src/main/java/org/apache/cxf/fediz/core/saml/SAMLTokenValidator.java
@@ -227,7 +227,7 @@ public class SAMLTokenValidator implements TokenValidator {
             for (Claim c : claims) {
                 if (roleURI.equals(c.getClaimType())) {
                     Object oValue = c.getValue();
-                    if ((oValue instanceof String) && !"".equals((String)oValue)) {
+                    if ((oValue instanceof String) && !"".equals(oValue)) {
                         if (delim == null) {
                             roles = Collections.singletonList((String)oValue);
                         } else {
@@ -259,8 +259,8 @@ public class SAMLTokenValidator implements TokenValidator {
             for (Claim c : claims) {
                 if (roleURI.equals(c.getClaimType())) {
                     Object oValue = c.getValue();
-                    if ((oValue instanceof String) && !"".equals((String)oValue)) {
-                        if (delim == null) {
+                    if (oValue instanceof String) {
+                        if (delim == null || "".equals(oValue)) {
                             roles = Collections.singletonList((String)oValue);
                         } else {
                             roles = parseRoles((String)oValue, delim);