cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: If a named principal is available then keep the existing sec context
Date Tue, 01 Dec 2015 21:15:35 GMT
Repository: cxf
Updated Branches:
  refs/heads/master f33bd39ce -> 0c8b46b4b


If a named principal is available then keep the existing sec context


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/0c8b46b4
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/0c8b46b4
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/0c8b46b4

Branch: refs/heads/master
Commit: 0c8b46b4b9e19e987a65513dc5ce8e8e351be58a
Parents: f33bd39
Author: Sergey Beryozkin <sberyozkin@gmail.com>
Authored: Tue Dec 1 21:15:16 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@gmail.com>
Committed: Tue Dec 1 21:15:16 2015 +0000

----------------------------------------------------------------------
 .../rs/security/jose/jaxrs/JwsContainerRequestFilter.java   | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0c8b46b4/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsContainerRequestFilter.java
----------------------------------------------------------------------
diff --git a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsContainerRequestFilter.java
b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsContainerRequestFilter.java
index 003e674..44ba01a 100644
--- a/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsContainerRequestFilter.java
+++ b/rt/rs/security/jose-parent/jose-jaxrs/src/main/java/org/apache/cxf/rs/security/jose/jaxrs/JwsContainerRequestFilter.java
@@ -60,9 +60,12 @@ public class JwsContainerRequestFilter extends AbstractJwsReaderProvider
impleme
             context.getHeaders().putSingle("Content-Type", ct);
         }
         
-        SecurityContext securityContext = configureSecurityContext(theSigVerifier);
-        if (securityContext != null) {
-            JAXRSUtils.getCurrentMessage().put(SecurityContext.class, securityContext);
+        Principal currentPrincipal = context.getSecurityContext().getUserPrincipal(); 
+        if (currentPrincipal != null && currentPrincipal.getName() != null) {
+            SecurityContext securityContext = configureSecurityContext(theSigVerifier);
+            if (securityContext != null) {
+                JAXRSUtils.getCurrentMessage().put(SecurityContext.class, securityContext);
+            }
         }
     }
     


Mime
View raw message