You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by lr...@apache.org on 2010/01/07 06:20:36 UTC
svn commit: r896752 -
/tuscany/sca-java-1.x/branches/sca-java-1.6/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java
Author: lresende
Date: Thu Jan 7 05:19:27 2010
New Revision: 896752
URL: http://svn.apache.org/viewvc?rev=896752&view=rev
Log:
TUSCANY-3389 - Tyding up the http response to properly distinguish from authentication and authorization exceptions and send the proper http status code
Modified:
tuscany/sca-java-1.x/branches/sca-java-1.6/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java
Modified: tuscany/sca-java-1.x/branches/sca-java-1.6/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java
URL: http://svn.apache.org/viewvc/tuscany/sca-java-1.x/branches/sca-java-1.6/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java?rev=896752&r1=896751&r2=896752&view=diff
==============================================================================
--- tuscany/sca-java-1.x/branches/sca-java-1.6/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java (original)
+++ tuscany/sca-java-1.x/branches/sca-java-1.6/modules/binding-jsonrpc-runtime/src/main/java/org/apache/tuscany/sca/binding/jsonrpc/provider/JSONRPCServiceServlet.java Thu Jan 7 05:19:27 2010
@@ -97,11 +97,13 @@
handleServiceRequest(request, response);
} catch(RuntimeException re) {
- if (re.getCause() instanceof javax.security.auth.login.FailedLoginException) {
- response.sendError(HttpServletResponse.SC_FORBIDDEN);
- }else if (re.getCause() instanceof javax.security.auth.login.LoginException) {
- response.setHeader("WWW-Authenticate", "BASIC realm=\"" + "ldap-realm" + "\"");
- response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+ if(re.getCause() instanceof javax.security.auth.login.LoginException) {
+ if (re.getCause() instanceof javax.security.auth.login.FailedLoginException) {
+ response.setHeader("WWW-Authenticate", "BASIC realm=\"" + "ldap-realm" + "\"");
+ response.sendError(HttpServletResponse.SC_UNAUTHORIZED);
+ }else {
+ response.sendError(HttpServletResponse.SC_FORBIDDEN);
+ }
}
} finally {
HttpSession session = request.getSession(false);