cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cohei...@apache.org
Subject svn commit: r1522592 - /cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
Date Thu, 12 Sep 2013 14:23:40 GMT
Author: coheigea
Date: Thu Sep 12 14:23:40 2013
New Revision: 1522592

URL: http://svn.apache.org/r1522592
Log:
[CXF-5275] - NullPointerException when using Kerberos Delegation

Modified:
    cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java

Modified: cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java?rev=1522592&r1=1522591&r2=1522592&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
(original)
+++ cxf/branches/2.6.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/auth/AbstractSpnegoAuthSupplier.java
Thu Sep 12 14:23:40 2013
@@ -96,17 +96,19 @@ public abstract class AbstractSpnegoAuth
     private byte[] getToken(AuthorizationPolicy authPolicy,
                             final GSSContext context) throws GSSException,
         LoginException {
+
+        final byte[] token = new byte[0];
+        if (authPolicy == null) {
+            return context.initSecContext(token, 0, token.length);
+        }
         
         String contextName = authPolicy.getAuthorization();
         if (contextName == null) {
             contextName = "";
         }
         
-        final byte[] token = new byte[0];
-
-        if (authPolicy == null 
-            || (StringUtils.isEmpty(authPolicy.getUserName())
-                && StringUtils.isEmpty(contextName) && loginConfig == null))
{
+        if (StringUtils.isEmpty(authPolicy.getUserName())
+                && StringUtils.isEmpty(contextName) && loginConfig == null)
{
             return context.initSecContext(token, 0, token.length);
         }
         



Mime
View raw message