title: Working with "codebases" in the security policy during development in Eclipse
body: <p>I am working with Java security policies and it's still rather new for me. I will like to be able to run the code directly as a launch configuration, so I have a debugger and all the other nice IDE stuff.</p>
  
  <p>I can get it to work until I use the <code>codebase</code> attribute in the policy.</p>
  
  <p>I have a class in the package <code>application</code> that creates a <code>LoginContext</code>. The policy file is located in the root of my project. With this content it works fine:</p>
  
  <pre><code>grant {
     permission javax.security.auth.AuthPermission "createLoginContext.Sample";
     permission javax.security.auth.AuthPermission "doAsPrivileged";
  };
  </code></pre>
  
  <p>But when I add the codebase it fails with <code>Cannot create LoginContext. access denied ("javax.security.auth.AuthPermission" "createLoginContext.Sample")</code></p>
  
  <pre><code>grant codebase "file:./bin/application/-" {
     permission javax.security.auth.AuthPermission "createLoginContext.Sample";
     permission javax.security.auth.AuthPermission "doAsPrivileged";
  };
  </code></pre>
  
  <p>I have tried these values for <code>codebase</code></p>
  
  <ol>
  <li>file:application/-</li>
  <li>file:./application/-</li>
  <li>file:bin/application/-</li>
  <li>file:./bin/application/-</li>
  <li>file:C:/Full Path/to/project/bin/application/-</li>
  <li>file://C:/Full Path/to/project/bin/application/-</li>
  </ol>
  
  <p>(In case it matters: The full path includes spaces)</p>