Repository: cxf Updated Branches: refs/heads/3.1.x-fixes b13d37d92 -> 3b272f9a3
Fixing 3.1.x build failure Project: http://git-wip-us.apache.org/repos/asf/cxf/repo Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/3b272f9a Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/3b272f9a Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/3b272f9a Branch: refs/heads/3.1.x-fixes Commit: 3b272f9a3ae43861a4e5894ea9d622954f0f5208 Parents: b13d37d Author: Sergey Beryozkin <sberyoz...@gmail.com> Authored: Tue Aug 9 17:19:12 2016 +0100 Committer: Sergey Beryozkin <sberyoz...@gmail.com> Committed: Tue Aug 9 17:19:12 2016 +0100 ---------------------------------------------------------------------- .../oauth2/filters/LocalJwtAccessTokenValidator.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cxf/blob/3b272f9a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/LocalJwtAccessTokenValidator.java ---------------------------------------------------------------------- diff --git a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/LocalJwtAccessTokenValidator.java b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/LocalJwtAccessTokenValidator.java index 3a83b36..afabf56 100644 --- a/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/LocalJwtAccessTokenValidator.java +++ b/rt/rs/security/oauth-parent/oauth2/src/main/java/org/apache/cxf/rs/security/oauth2/filters/LocalJwtAccessTokenValidator.java @@ -74,8 +74,13 @@ public class LocalJwtAccessTokenValidator extends JoseJwtConsumer implements Acc } Object resourceAud = claims.getClaim("resource"); if (resourceAud != null) { - atv.setAudiences(resourceAud instanceof List ? CastUtils.cast((List<?>)resourceAud) - : Collections.<String>singletonList((String)resourceAud)); + List<String> auds = null; + if (resourceAud instanceof List) { + auds = CastUtils.cast((List<?>)resourceAud); + } else { + auds = Collections.singletonList((String)resourceAud); + } + atv.setAudiences(auds); } if (claims.getIssuer() != null) { atv.setTokenIssuer(claims.getIssuer());