cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject cxf git commit: [CXF-6534] - Another attempt at this to try to get jenkins builds passing
Date Tue, 25 Aug 2015 14:03:17 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 513c5913a -> 5f6fa0324


[CXF-6534] - Another attempt at this to try to get jenkins builds passing


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

Branch: refs/heads/3.0.x-fixes
Commit: 5f6fa0324dae2b8285a3e1a78cf0b23fa25c41a8
Parents: 513c591
Author: Colm O hEigeartaigh <coheigea@apache.org>
Authored: Tue Aug 25 14:55:09 2015 +0100
Committer: Colm O hEigeartaigh <coheigea@apache.org>
Committed: Tue Aug 25 15:03:09 2015 +0100

----------------------------------------------------------------------
 .../http/auth/AbstractSpnegoAuthSupplier.java   | 34 ++++++++++----------
 1 file changed, 17 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5f6fa032/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
index f284072..713b55c 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
@@ -101,27 +101,11 @@ public abstract class AbstractSpnegoAuthSupplier {
                             Message message) throws GSSException, 
         LoginException {
         
-        GSSManager manager = GSSManager.getInstance();
-        GSSName serverName = manager.createName(spn, serviceNameType);
-
         GSSCredential delegatedCred = 
             (GSSCredential)message.getContextualProperty(GSSCredential.class.getName());
         
-        GSSContext context = manager
-                .createContext(serverName.canonicalize(oid), oid, delegatedCred, GSSContext.DEFAULT_LIFETIME);
-        
-        context.requestCredDeleg(isCredDelegationRequired(message));
-
-        // If the delegated cred is not null then we only need the context to
-        // immediately return a ticket based on this credential without attempting
-        // to log on again 
-        final byte[] token = new byte[0];
-        if (delegatedCred != null) {
-            return context.initSecContext(token, 0, token.length);
-        }
-        
         Subject subject = null;
-        if (authPolicy != null) {
+        if (authPolicy != null && delegatedCred == null) {
             String contextName = authPolicy.getAuthorization();
             if (contextName == null) {
                 contextName = "";
@@ -137,6 +121,22 @@ public abstract class AbstractSpnegoAuthSupplier {
             }
         }
         
+        GSSManager manager = GSSManager.getInstance();
+        GSSName serverName = manager.createName(spn, serviceNameType);
+        
+        GSSContext context = manager
+                .createContext(serverName.canonicalize(oid), oid, delegatedCred, GSSContext.DEFAULT_LIFETIME);
+        
+        context.requestCredDeleg(isCredDelegationRequired(message));
+
+        // If the delegated cred is not null then we only need the context to
+        // immediately return a ticket based on this credential without attempting
+        // to log on again 
+        final byte[] token = new byte[0];
+        if (delegatedCred != null) {
+            return context.initSecContext(token, 0, token.length);
+        }
+        
         try {
             return (byte[])Subject.doAs(subject, new CreateServiceTicketAction(context, token));
         } catch (PrivilegedActionException e) {


Mime
View raw message