cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1325316 - in /cxf/branches/2.5.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/JAASAuthenticationFilter.java
Date Thu, 12 Apr 2012 15:15:48 GMT
Author: sergeyb
Date: Thu Apr 12 15:15:48 2012
New Revision: 1325316

URL: http://svn.apache.org/viewvc?rev=1325316&view=rev
Log:
Merged revisions 1325314 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1325314 | sergeyb | 2012-04-12 16:10:31 +0100 (Thu, 12 Apr 2012) | 1 line
  
  Updating JAASAuthenticationFilter to default to Basic WWW-Authenticate challenge
........

Modified:
    cxf/branches/2.5.x-fixes/   (props changed)
    cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/JAASAuthenticationFilter.java

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1325314

Propchange: cxf/branches/2.5.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/JAASAuthenticationFilter.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/JAASAuthenticationFilter.java?rev=1325316&r1=1325315&r2=1325316&view=diff
==============================================================================
--- cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/JAASAuthenticationFilter.java
(original)
+++ cxf/branches/2.5.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/security/JAASAuthenticationFilter.java
Thu Apr 12 15:15:48 2012
@@ -116,19 +116,22 @@ public class JAASAuthenticationFilter im
         } else {
             ResponseBuilder builder = Response.status(Response.Status.UNAUTHORIZED);
             
+            StringBuilder sb = new StringBuilder();
+            
             List<String> authHeader = headers.getRequestHeader(HttpHeaders.AUTHORIZATION);
             if (authHeader.size() > 0) {
-                StringBuilder sb = new StringBuilder();
                 // should HttpHeadersImpl do it ?
                 String[] authValues = authHeader.get(0).split(" ");
                 if (authValues.length > 0) {
                     sb.append(authValues[0]);
-                    if (realmName != null) {
-                        sb.append(' ').append(realmName);
-                    }
-                    builder.header(HttpHeaders.WWW_AUTHENTICATE, sb.toString());
                 }
+            } else {
+                sb.append("Basic");
+            }
+            if (realmName != null) {
+                sb.append(' ').append(realmName);
             }
+            builder.header(HttpHeaders.WWW_AUTHENTICATE, sb.toString());
             
             return builder.build();
         }



Mime
View raw message