[Registry-dev] svn commit r13219 - branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app

svn at wso2.org svn at wso2.org
Fri Feb 1 02:20:51 PST 2008


Author: deepal
Date: Fri Feb  1 02:20:45 2008
New Revision: 13219

Log:

fixing AuthorizationFailedException to get the basic auth 

Modified:
   branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java

Modified: branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java
==============================================================================
--- branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java	(original)
+++ branches/registry/1_0/modules/core/src/main/java/org/wso2/registry/app/AtomRegistry.java	Fri Feb  1 02:20:45 2008
@@ -36,10 +36,12 @@
 import org.apache.commons.logging.LogFactory;
 import org.wso2.registry.Comment;
 import org.wso2.registry.*;
+import org.wso2.registry.servlet.utils.Utils;
 import org.wso2.registry.exceptions.ResourceNotFoundException;
 import org.wso2.registry.i18n.Messages;
 import org.wso2.registry.jdbc.realm.RegistryRealm;
 import org.wso2.registry.secure.SecureRegistry;
+import org.wso2.registry.secure.AuthorizationFailedException;
 
 import javax.activation.MimeType;
 import javax.xml.namespace.QName;
@@ -327,6 +329,10 @@
             resource = getSecureRegistry(request).get(resourcePath);
         } catch (ResourceNotFoundException e) {
             return new EmptyResponseContext(404);
+        } catch(AuthorizationFailedException e) {
+            EmptyResponseContext response = new EmptyResponseContext(401);
+            response.setHeader("WWW-Authenticate", "Basic realm=\"WSO2-Registry\"");
+            return response;
         } catch (RegistryException e) {
             return new StringResponseContext(request.getAbdera(), e, 500);
         }



More information about the Registry-dev mailing list