Java thread identity and an operating system thread identity
You can specify options to synchronize a Java™ thread identity and an operating system thread identity.
Enterprise JavaBeans (EJB) support a method-level RunAs role specification that associates a Java Platform, Enterprise Edition (Java EE) role with an EJB method invocation. The EJB method runs by using the authority that is associated with the designated security role. The authority is mapped to the designated role by using a user identity. Normally, this identity is recognized by web-based and Java EE runtime and is associated with the current dispatch thread. This identity governs access to only those resources and those facilities subject to Java EE security. The actual OS thread identity is unaffected by the EJB RunAs role selection and is typically the identity of the server.
Setting the OS identity thread synchronizes the Java EE role identity and OS thread (SyncToOSThread). This means that the OS thread identity is associated with the Java EE role identity during the EJB method invocation (application assemblers and deployers associate the RunAs identity with the operating system thread by setting the thread identity to the RunAs identity for specific bean methods). This association means that the caller or security role identity (rather than the server region identity) is used for z/OS® system service requests such as access to files and database management systems. The WebSphere® Application Server for z/OS Java EE server can be configured to enable or disable this association (or synchronization). The default setting disables the ability to modify the identity on the operating system thread, regardless of the OS thread identity to RunAs identity setting in the deployment descriptor for the installed application. If the application installer does not enable synchronization, any method that sets the RunAs identity to the operating system thread fails with a no_permission error.
You complete the specification of options to synchronize a Java thread identity and an operating system thread identity by using the resource access control facility (RACF®) to define FACILITY and optionally SURROGAT class profiles for Sync to OS Thread Allowed. This gives the RACF administrator in the WebSphere Application Server configuration the ability to control the permissions that allow the synchronization of the Java EE role identity and the OS thread (SyncToOSThread).
- Enable WebSphere Application Server and z/OS thread identity synchronization
- Specifies whether an application SynchToOSThread is permitted. When this security option is selected (meaning true is specified) the application-specified SyncToOSThread is honored and then carried out by the EJB and web containers as indicated by EJB and web application SyncToOSThread specifications. The default is false or disabled.
- Enable the connection manager RunAs thread identity
- Specifies whether the connection manager synchronizes the current Java EE principal to the OS thread when a connection is obtained from a resource reference that specifies res-auth=container. The default is false or disabled.
- True, which specifies that the Java EE principal or identity should be synchronized to the OS thread for all requests that are invoked on the EJB or web application.
- False, specifies the Java EE principal application or identity should not be synchronized to the OS thread for all requests that are invoked on the EJB or web application. This value is the default.
- Local OS
- LDAP
- Custom
- Initial value when the first method is set
- By default, invocations of servlet service methods and EJB business
methods implicitly run as caller (RunAsCaller) unless the Run as field
of a policy's attribute specifies otherwise. EJB client applications
always run as server (RunAsServer). Note: For web applications, if security constraints are not specified, the application might run with an unauthenticated user ID.
- Method delegation changes to the Java EE identity (RunAs Specified)
- The connection manager synchronizes the current Java EE identity with the OS thread when obtaining applications from resources references that have container-managed resource authorization (res-auth=container). EJB methods marked with SynchToOSThread cause the Java EE role identity to be synchronized to the OS thread.
- WSSubject.doAs()
- This setting offers flexibility when associating the Subject with remote calls on a thread without having to do a WSSubject.doAs() to associate the subject with the remote action.
- JavaServer Pages (JSP) Compilation
- Web container JSP compilation modifies the identity of the server if SyncToOSThread is enabled for the server (security_EnableSyncToOSThread=1).
- Access of Stateful Backing Store
- EJB container stateful session activation changes the identity of the server if SyncToOSThread is enabled. Always access the EJB stateful session backing store by using the identity of the server.
- Web application Reloading
- When the web container reloads the web application, it changes the server identity if SyncToOSThread is enabled for web applications.
- Connection Manager Requests
- When the resource reference specifies res-auth=application, the thread identity is temporarily set to the identity of the server.