Enhance filter so it operates when remote_user isn't present.
authorcantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 2 Aug 2005 18:54:43 +0000 (18:54 +0000)
committercantor <cantor@ab3bd59b-922f-494d-bb5f-6f0a3c29deca>
Tue, 2 Aug 2005 18:54:43 +0000 (18:54 +0000)
git-svn-id: https://subversion.switch.ch/svn/shibboleth/java-idp/trunk@1777 ab3bd59b-922f-494d-bb5f-6f0a3c29deca

src/edu/internet2/middleware/shibboleth/utils/KerberosPrincipalFilter.java

index 6fbf224..20e64df 100644 (file)
@@ -63,10 +63,15 @@ public class KerberosPrincipalFilter implements Filter {
                HttpServletRequest httpRequest = (HttpServletRequest) request;
 
                String name = httpRequest.getRemoteUser();
-               int split = name.indexOf('@');
-               if (split > -1) name = name.substring(0, split);
-
-               chain.doFilter(new KerberosPrincipalWrapper(httpRequest, new PrincipalImpl(name)), response);
+               if (name != null) {
+                       int split = name.indexOf('@');
+                       if (split > -1) {
+                               name = name.substring(0, split);
+                               chain.doFilter(new KerberosPrincipalWrapper(httpRequest, new PrincipalImpl(name)), response);
+                               return;
+                       }
+               }
+               chain.doFilter(request, response);
        }
 
        /**