Security order of precedence used for the execution of J2EE tasks

There are three ways of verifying that a task will run with the correct user credentials. Tasks run with specified security credentials using the following methods:
  1. Using the Java Authentication and Authorization Service (JAAS) security context on the thread at the time the task was created.
  2. Using the setAuthenticationAlias method on the TaskInfo object.
  3. Using a specified security identity on a BeanTaskInfo task TaskHandler method.

The authentication methods are sorted in the order listed above, so that if an authentication method succeeds, the following checks are ignored. This means that the usr and pwd credentials defined in Configure the Java security win over any credentials specified in the tasks themselves.