title: Configuring sample webcontext with JOSSO+TOMCAT
body: <p>Newbie to JOSSO. I have setup JOSSO with tomcat and the partnerapp seems to be working correctly. I have a 'sample' webapp which i'm trying to configure with JOSSO. The JOSSO login page correctly appears when i try to access the webapp however <strong>after i login successfully i get the following exception</strong></p>
  
  <pre><code>java.lang.RuntimeException: Outbound relaying failed. No Principal found. Verify your SSO Agent Configuration!
      org.josso.tc60.agent.SSOAgentValve.invoke(SSOAgentValve.java:551)
      org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
      org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
      org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
      java.lang.Thread.run(Thread.java:722)
  </code></pre>
  
  <p>I have added partner-app entry to josso-agent-config.xml.</p>
  
  <pre><code>&lt;agent:partner-app id="MySampleApp" context="/sample"/&gt;
  </code></pre>
  
  <p>My web.xml looks like this </p>
  
  <pre><code>...
      &lt;welcome-file-list id="WelcomeFileList"&gt;
          &lt;welcome-file&gt;index.html&lt;/welcome-file&gt;
      &lt;/welcome-file-list&gt;
  
      &lt;security-constraint&gt;
          &lt;!-- Sample Security Constraint --&gt;
          &lt;web-resource-collection&gt;
  
              &lt;!-- We're going to protect this resource and make it available only to users in "role1". --&gt;
              &lt;web-resource-name&gt;protected-resources&lt;/web-resource-name&gt;
  
              &lt;url-pattern&gt;/*&lt;/url-pattern&gt;
  
              &lt;http-method&gt;HEAD&lt;/http-method&gt;
              &lt;http-method&gt;GET&lt;/http-method&gt;
              &lt;http-method&gt;POST&lt;/http-method&gt;
              &lt;http-method&gt;PUT&lt;/http-method&gt;
              &lt;http-method&gt;DELETE&lt;/http-method&gt;
  
          &lt;/web-resource-collection&gt;
  
          &lt;!-- NOTE: This role names will be retrieved by Josso using the proper identity store. --&gt;
          &lt;auth-constraint&gt;
              &lt;role-name&gt;role1&lt;/role-name&gt;
          &lt;/auth-constraint&gt;
  
          &lt;user-data-constraint&gt;
              &lt;transport-guarantee&gt;NONE&lt;/transport-guarantee&gt;
          &lt;/user-data-constraint&gt;
  
      &lt;/security-constraint&gt;  
  
      &lt;security-role &gt;
          &lt;description&gt;Role 1&lt;/description&gt;
          &lt;role-name&gt;role1&lt;/role-name&gt;
      &lt;/security-role&gt;
  
      &lt;login-config&gt;
  
          &lt;auth-method&gt;FORM&lt;/auth-method&gt;
  
          &lt;form-login-config&gt;
              &lt;!--
              NOTE: This will redirect the user to the proper login page provided by JOSSO.
              --&gt;
              &lt;form-login-page&gt;/login-redirect.jsp&lt;/form-login-page&gt;
              &lt;form-error-page&gt;/login-redirect.jsp&lt;/form-error-page&gt;
  
  
          &lt;/form-login-config&gt;
  
      &lt;/login-config&gt;
  ...
  </code></pre>
  
  <p>Created a sample.xml file in c:\tomcat_dir\conf\Catlina\localhost which looks like this</p>
  
  <pre><code>&lt;Context docBase="${catalina.home}/webapps/sample" privileged="true" antiResourceLocking="true" antiJARLocking="true"&gt;
      &lt;Realm className="org.apache.catalina.realm.UserDatabaseRealm" resourceName="UserDatabase"/&gt;
  &lt;/Context&gt;
  </code></pre>
  
  <p>Any feedback on this issue would be appreciated.</p>
  
  <p>Crossposted on <a href="https://sourceforge.net/projects/josso/forums/forum/399714/topic/4959641" rel="nofollow">JOSSO forum</a></p>