From dd57224ab51cc377dd7dfb34487f95f16895baaf Mon Sep 17 00:00:00 2001 From: Mathieu Baudier Date: Thu, 19 Nov 2009 17:26:28 +0000 Subject: [PATCH] Introduce form login git-svn-id: https://svn.argeo.org/commons/trunk@3116 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- .../META-INF/MANIFEST.MF | 4 +- .../WEB-INF/security.xml | 39 +- .../security/mvc/UsersRolesController.java | 26 +- .../META-INF/MANIFEST.MF | 3 +- .../WEB-INF/applicationContext.xml | 1 + .../WEB-INF/web-orig.xml | 381 ++++++++++++++++++ 6 files changed, 429 insertions(+), 25 deletions(-) create mode 100644 server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/web-orig.xml diff --git a/security/modules/org.argeo.security.webapp/META-INF/MANIFEST.MF b/security/modules/org.argeo.security.webapp/META-INF/MANIFEST.MF index 50e07d832..4df4ae832 100644 --- a/security/modules/org.argeo.security.webapp/META-INF/MANIFEST.MF +++ b/security/modules/org.argeo.security.webapp/META-INF/MANIFEST.MF @@ -1,5 +1,6 @@ Bundle-SymbolicName: org.argeo.security.webapp Bundle-Version: 0.1.2.SNAPSHOT +Web-ContextPath: org.argeo.security.webapp Import-Package: javax.servlet, javax.servlet.http, javax.servlet.resources, @@ -10,8 +11,9 @@ Import-Package: javax.servlet, org.springframework.ldap.core.support, org.springframework.osgi.web.context.support, org.springframework.security, + org.springframework.security.config, + org.springframework.security.ui.webapp, org.springframework.web.context, org.springframework.web.context.support, org.springframework.web.filter, org.springframework.web.servlet -Web-ContextPath: org.argeo.security.webapp diff --git a/security/modules/org.argeo.security.webapp/WEB-INF/security.xml b/security/modules/org.argeo.security.webapp/WEB-INF/security.xml index 7b9bc9d80..3ae36186f 100644 --- a/security/modules/org.argeo.security.webapp/WEB-INF/security.xml +++ b/security/modules/org.argeo.security.webapp/WEB-INF/security.xml @@ -1,12 +1,31 @@ - + + - - - - - + + + + - + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/security/runtime/org.argeo.security.mvc/src/main/java/org/argeo/security/mvc/UsersRolesController.java b/security/runtime/org.argeo.security.mvc/src/main/java/org/argeo/security/mvc/UsersRolesController.java index 662c20fb3..8f096937f 100644 --- a/security/runtime/org.argeo.security.mvc/src/main/java/org/argeo/security/mvc/UsersRolesController.java +++ b/security/runtime/org.argeo.security.mvc/src/main/java/org/argeo/security/mvc/UsersRolesController.java @@ -32,19 +32,19 @@ public class UsersRolesController implements MvcConstants { return securityService.getSecurityDao().getCurrentUser(); } - @RequestMapping("/login.security") - @ModelAttribute(ANSWER_MODEL_KEY) - public ArgeoUser login(@RequestParam("username") String username, - @RequestParam("password") String password) { - //SecurityContextHolder.getContext().getAuthentication(). - return securityService.getSecurityDao().getCurrentUser(); - } - - @RequestMapping("/logout.security") - @ModelAttribute(ANSWER_MODEL_KEY) - public ServerAnswer logout() { - return ServerAnswer.ok("Logged out"); - } +// @RequestMapping("/login.security") +// @ModelAttribute(ANSWER_MODEL_KEY) +// public ArgeoUser login(@RequestParam("username") String username, +// @RequestParam("password") String password) { +// //SecurityContextHolder.getContext().getAuthentication(). +// return securityService.getSecurityDao().getCurrentUser(); +// } +// +// @RequestMapping("/logout.security") +// @ModelAttribute(ANSWER_MODEL_KEY) +// public ServerAnswer logout() { +// return ServerAnswer.ok("Logged out"); +// } @RequestMapping("/getUsersList.security") @ModelAttribute(ANSWER_MODEL_KEY) diff --git a/server/modules/org.argeo.server.catalina/META-INF/MANIFEST.MF b/server/modules/org.argeo.server.catalina/META-INF/MANIFEST.MF index 90b6df90d..7313b4b36 100644 --- a/server/modules/org.argeo.server.catalina/META-INF/MANIFEST.MF +++ b/server/modules/org.argeo.server.catalina/META-INF/MANIFEST.MF @@ -8,4 +8,5 @@ Import-Package: org.springframework.security;resolution:=optional, org.springframework.security.ui;resolution:=optional, org.springframework.security.ui.savedrequest;resolution:=optional, org.springframework.security.userdetails;resolution:=optional, - org.springframework.security.context;resolution:=optional + org.springframework.security.context;resolution:=optional, + org.argeo.security.core;resolution:=optional diff --git a/server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/applicationContext.xml b/server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/applicationContext.xml index 39d17be83..d2403d92b 100644 --- a/server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/applicationContext.xml +++ b/server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/applicationContext.xml @@ -9,4 +9,5 @@ + \ No newline at end of file diff --git a/server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/web-orig.xml b/server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/web-orig.xml new file mode 100644 index 000000000..a8e5fdd8f --- /dev/null +++ b/server/modules/org.argeo.server.jackrabbit.webapp/WEB-INF/web-orig.xml @@ -0,0 +1,381 @@ + + + + + + Jackrabbit JCR Server + + + + + + + + + + + + + + + + + + + + + + + + Repository + + This servlet provides other servlets and jsps a common way to access + the repository. The repository can be accessed via JNDI, RMI or Webdav. + + org.apache.jackrabbit.j2ee.RepositoryAccessServlet + + + bootstrap-config + jackrabbit/bootstrap.properties + + Property file that hold the same initialization properties than + the init-params below. If a parameter is specified in both + places the one in the bootstrap-config wins. + + + + + + + + + + 3 + + + + + + + Webdav + + The webdav servlet that connects HTTP request to the repository. + + org.apache.jackrabbit.j2ee.SimpleWebdavServlet + + + resource-path-prefix + /repository + + defines the prefix for spooling resources out of the repository. + + + + + + + + resource-config + /WEB-INF/config.xml + + Defines various dav-resource configuration parameters. + + + 4 + + + + + + + JCRWebdavServer + + The servlet used to remote JCR calls over HTTP. + + org.apache.jackrabbit.j2ee.JcrRemotingServlet + + missing-auth-mapping + + + Defines how a missing authorization header should be handled. + 1) If this init-param is missing, a 401 response is generated. + This is suiteable for clients (eg. webdav clients) for which + sending a proper authorization header is not possible if the + server never sent a 401. + 2) If this init-param is present with an empty value, + null-credentials are returned, thus forcing an null login + on the repository. + 3) If this init-param has a 'user:password' value, the respective + simple credentials are generated. + + + + + + resource-path-prefix + /server + + defines the prefix for spooling resources out of the repository. + + + + + + batchread-config + /WEB-INF/batchread.properties + JcrRemotingServlet: Optional mapping from node type names to default depth. + + 5 + + + + + + + + + + + + + Webdav + /repository/* + + + JCRWebdavServer + /server/* + + + + + + + index.jsp + + + + org.apache.jackrabbit.j2ee.JcrApiNotFoundException + /error/classpath.jsp + + + javax.jcr.RepositoryException + /error/repository.jsp + + + -- 2.30.2