protected List getRoles()

in plugins/core/src/main/java/org/apache/cxf/fediz/core/processor/AbstractFedizProcessor.java [121:143]


    protected List<String> getRoles(List<Claim> claims, URI roleURI) {
        if (claims == null || roleURI == null) {
            return null;
        }
        List<String> roles = null;
        for (Claim c : claims) {
            if (roleURI.equals(c.getClaimType())) {
                Object oValue = c.getValue();
                if (oValue instanceof String && !"".equals(oValue)) {
                    roles = Collections.singletonList((String) oValue);
                } else if (oValue instanceof List<?> && !((List<?>) oValue).isEmpty()) {
                    @SuppressWarnings("unchecked")
                    List<String> values = (List<String>) oValue;
                    roles = Collections.unmodifiableList(values);
                } else if (!(oValue instanceof String || oValue instanceof List<?>)) {
                    LOG.error("Unsupported value type of Claim value");
                    throw new IllegalStateException("Unsupported value type of Claim value");
                }
                break;
            }
        }
        return roles;
    }