AppSecurityContext supports two modes in setting and getting application ID, the new "AppSecurityContext" mode and "PolicyContext" mode. The "PolicyContext" mode provides backward-compatibility in setting and getting context ID with JACC PolicyContext, the "AppSecurityContext" mode creates a new thread-scoped variable to store application ID. This class checks system property "oracle.security.jps.appsecuritycontext.appsecuritycontextmode" to decide which mode to use for setting and getting application ID. If this system property is not set or set to false, "PolicyContext" mode is enabled. Otherwise, "AppSecurityContext" mode is enabled.

When calling AppSecurityContext.setApplicationID method, it requires callers to have codebase permission grant of JpsPermission("AppSecurityContext.setApplicationID.<app ID>").