title: shiro redirects me back to login.jsp
body: <p>was just tying to integrate apache shiro with another application. but shiro is not authenticating and redirecting me back to login.jsp. Follow is the explanation</p>
  
  <p>I created a test application with apache shiro, that is using jdbcrealm and working fine. the redirect to login page and successful authentication is happening. below is shiro.ini</p>
  
  <pre><code>[main]
  authc.loginUrl = /login.jsp
  authc.usernameParam = user
  authc.passwordParam = pass
  authc.rememberMeParam = remember
  authc.successUrl  = /p/explorer
  
  jdbcRealm = org.apache.shiro.realm.jdbc.JdbcRealm
  jdbcRealm.permissionsLookupEnabled = true
  jdbcRealm.authenticationQuery = select PWD_ as password from act_id_user where ID_ = ?
  jdbcRealm.userRolesQuery = select GROUP_ID_ as role_name from act_id_membership where USER_ID_ = ?
  jdbcRealm.permissionsQuery = select permission from roles_permissions where GROUP_ID_ = ?
  
  ds = org.apache.commons.dbcp.BasicDataSource
  ds.url = jdbc:mysql://localhost:3306/activiti
  ds.driverClassName = com.mysql.jdbc.Driver
  ds.username=user
  ds.password=pass
  ds.maxActive = 3
  
  securityManager.realms = $jdbcRealm
  cacheManager = org.apache.shiro.cache.ehcache.EhCacheManager
  securityManager.cacheManager = $cacheManager
  
  jdbcRealm.dataSource = $ds
  
  sha256Matcher = org.apache.shiro.authc.credential.HashedCredentialsMatcher
  sha256Matcher.hashAlgorithmName=SHA-256
  jdbcRealm.credentialsMatcher = $sha256Matcher
  
  
  [urls]
  # enable authc filter for all application pages
  /p/**=authc
  </code></pre>
  
  <p>please note the above configuration is working in my test application (run using mvn jetty:run).</p>
  
  <p>I then copied the same configuration, login.jsp and filter settings from web.xml to another application (namely signavio activiti-modeler), upon accessing the URL it is redirecting me to login page but submitting doesn't result in exception and/or erorr in logs but still its redirecting me back to login.jsp. here is web.xml (shiro is the first filter in filter-chain)</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
  id="WebApp_ID" version="2.5"&gt;
  &lt;display-name&gt;Signavio Platform&lt;/display-name&gt;
  
  &lt;distributable /&gt;
  
  
  &lt;context-param&gt;
      &lt;description&gt;Define a reg exp for all user agents which are supported for the editor&lt;/description&gt;
      &lt;param-name&gt;supportedBrowserEditor&lt;/param-name&gt;
      &lt;param-value&gt;Firefox[\/\s]((3|4|5|6|7|8|9|10|11|12|13|14|15|16|17|18|19|20)\.\d+)|AppleWebKit|Opera.9\.\d+&lt;/param-value&gt;
  &lt;/context-param&gt;
  
  &lt;context-param&gt;
      &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt;
      &lt;param-value&gt;/WEB-INF/applicationContext.xml&lt;/param-value&gt;
  &lt;/context-param&gt;
  &lt;!-- To load the Spring context --&gt;
  &lt;listener&gt;
      &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt;
  &lt;/listener&gt;
  
  
  &lt;!--FILTER --&gt;
  &lt;filter&gt;
      &lt;filter-name&gt;ShiroFilter&lt;/filter-name&gt;
      &lt;filter-class&gt;org.apache.shiro.web.servlet.IniShiroFilter&lt;/filter-class&gt;
  &lt;/filter&gt;
  &lt;filter-mapping&gt;
      &lt;filter-name&gt;ShiroFilter&lt;/filter-name&gt;
      &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  &lt;/filter-mapping&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;RequestExceptionFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;com.signavio.platform.filters.RequestExceptionFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;HandlerFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;com.signavio.platform.filters.HandlerFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;EncodingFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;com.signavio.platform.filters.EncodingFilter&lt;/filter-class&gt;
          &lt;init-param&gt;
              &lt;param-name&gt;encoding&lt;/param-name&gt;
              &lt;param-value&gt;
                  UTF-8
              &lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/filter&gt;
  
  
      &lt;filter&gt;
          &lt;filter-name&gt;AuthenticationFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;com.signavio.platform.filters.AuthenticationFilter&lt;/filter-class&gt;
          &lt;init-param&gt;
              &lt;description&gt;&lt;/description&gt;
              &lt;param-name&gt;requiresNoAuthorization&lt;/param-name&gt;
              &lt;param-value&gt;
              &lt;/param-value&gt;
          &lt;/init-param&gt;
      &lt;/filter&gt;
  
      &lt;filter&gt;
          &lt;filter-name&gt;ParseParametersFilter&lt;/filter-name&gt;
          &lt;filter-class&gt;com.signavio.platform.filters.ParseParametersFilter&lt;/filter-class&gt;
      &lt;/filter&gt;
  
      &lt;!--FILTER MAPPING --&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;RequestExceptionFilter&lt;/filter-name&gt;
          &lt;url-pattern&gt;
              /p/*
          &lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;HandlerFilter&lt;/filter-name&gt;
          &lt;url-pattern&gt;
              /p/*
          &lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;EncodingFilter&lt;/filter-name&gt;
          &lt;url-pattern&gt;
              /p/*
          &lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;AuthenticationFilter&lt;/filter-name&gt;
          &lt;url-pattern&gt;
              /p/*
          &lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;filter-mapping&gt;
          &lt;filter-name&gt;ParseParametersFilter&lt;/filter-name&gt;
          &lt;url-pattern&gt;
              /p/*
          &lt;/url-pattern&gt;
      &lt;/filter-mapping&gt;
  
      &lt;!--SERVLETS --&gt;
      &lt;servlet&gt;
          &lt;display-name&gt;Dispatcher&lt;/display-name&gt;
          &lt;servlet-name&gt;Dispatcher&lt;/servlet-name&gt;
          &lt;servlet-class&gt;com.signavio.platform.servlets.DispatcherServlet&lt;/servlet-class&gt;
          &lt;load-on-startup&gt;1&lt;/load-on-startup&gt;
      &lt;/servlet&gt;
  
      &lt;!--SERVLET MAPPING --&gt;
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Dispatcher&lt;/servlet-name&gt;
          &lt;url-pattern&gt;
              /p/*
          &lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;!--LISTENER --&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;com.signavio.platform.listeners.EntryPoint&lt;/listener-class&gt;
      &lt;/listener&gt;
  
      &lt;!--SESSION CONFIG --&gt;
      &lt;session-config&gt;
          &lt;session-timeout&gt;1440&lt;/session-timeout&gt;
      &lt;/session-config&gt;
  
      &lt;!--ERROR PAGES --&gt;
  
      &lt;!--MIME MAPPING --&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;svg&lt;/extension&gt;
          &lt;mime-type&gt;image/svg+xml&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;json&lt;/extension&gt;
          &lt;mime-type&gt;text/plain&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;css&lt;/extension&gt;
          &lt;mime-type&gt;text/css&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
      &lt;mime-mapping&gt;
          &lt;extension&gt;ico&lt;/extension&gt;
          &lt;mime-type&gt;image/x-icon&lt;/mime-type&gt;
      &lt;/mime-mapping&gt;
  
      &lt;security-role&gt;
          &lt;role-name&gt;admin&lt;/role-name&gt;
      &lt;/security-role&gt;
  
      &lt;!--WELCOME FILE LIST --&gt;
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;welcome&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
      &lt;!-- Servlets from the Oryx Editor --&gt;
      &lt;servlet&gt;
          &lt;display-name&gt;BPMN Layouter&lt;/display-name&gt;
          &lt;servlet-name&gt;BPMNLayouterServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.oryxeditor.server.BPMNLayouterServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet&gt;
          &lt;display-name&gt;BPMN2BPEL Servlet&lt;/display-name&gt;
          &lt;servlet-name&gt;BPMN2BPELServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.oryxeditor.server.BPMN2BPELServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet&gt;
          &lt;display-name&gt;Step Through&lt;/display-name&gt;
          &lt;servlet-name&gt;StepThrough&lt;/servlet-name&gt;
          &lt;servlet-class&gt;de.hpi.diagram.stepthrough.StepThroughServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet&gt;
          &lt;display-name&gt;XForms Export&lt;/display-name&gt;
          &lt;servlet-name&gt;XFormsExportServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.oryxeditor.server.XFormsExportServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet&gt;
          &lt;display-name&gt;XForms Import&lt;/display-name&gt;
          &lt;servlet-name&gt;XFormsImportServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.oryxeditor.server.XFormsImportServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet&gt;
          &lt;display-name&gt;Oryx Legacy File Download Servlet&lt;/display-name&gt;
          &lt;servlet-name&gt;DownloadServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;
              org.oryxeditor.server.MultiDownloader
          &lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet&gt;
          &lt;display-name&gt;Alternatives Renderer&lt;/display-name&gt;
          &lt;servlet-name&gt;AlternativesRenderer&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.oryxeditor.server.AlternativesRenderer&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet&gt;
          &lt;display-name&gt;Oryx syntax checker&lt;/display-name&gt;
          &lt;servlet-name&gt;SyntaxChecker&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.oryxeditor.server.SyntaxCheckerServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet&gt;
          &lt;display-name&gt;Oryx Validator&lt;/display-name&gt;
          &lt;servlet-name&gt;Validator&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.oryxeditor.server.ValidatorServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet&gt;
          &lt;display-name&gt;RDF 2 JSON Servlet&lt;/display-name&gt;
          &lt;servlet-name&gt;RDF2JSONServlet&lt;/servlet-name&gt;
          &lt;servlet-class&gt;org.oryxeditor.server.RDF2JSONServlet&lt;/servlet-class&gt;
      &lt;/servlet&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;BPMNLayouterServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/editor/bpmnlayouter&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;BPMN2BPELServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/editor/bpmn2bpel&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;StepThrough&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/editor/stepthrough&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;XFormsExportServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/editor/xformsexport&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;XFormsImportServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/editor/xformsimport&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;SyntaxChecker&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/editor/syntaxchecker&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;Validator&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/editor/validator&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;DownloadServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/editor/download&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;AlternativesRenderer&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/editor/pdf&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;servlet-mapping&gt;
          &lt;servlet-name&gt;RDF2JSONServlet&lt;/servlet-name&gt;
          &lt;url-pattern&gt;/editor/rdf2json&lt;/url-pattern&gt;
      &lt;/servlet-mapping&gt;
  
      &lt;welcome-file-list&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>Please again note that this settings is working simple/test webapplication my doubts are..
  client/server redirection and/or filter chain sequence.</p>
  
  <p>Thanks in advance.</p>