code: private void syncToOSThread(WebSecurityContext webSecurityContext) throws SecurityViolationException {
          try {
              Object token = ThreadIdentityManager.setAppThreadIdentity(subjectManager.getInvocationSubject());
              webSecurityContext.setSyncToOSThreadToken(token);
          } catch (ThreadIdentityException tie) {
              SecurityViolationException secVE = convertWebSecurityException(new WebSecurityCollaboratorException(tie.getMessage(), DENY_AUTHZ_FAILED, webSecurityContext));
              throw secVE;
          }
      }
docs: Sync the invocation Subject's identity to the thread, if request by the application.
  
  @param WebSecurityContext The security context object for this application invocation.
  MUST NOT BE NULL.
  @throws SecurityViolationException