run-as-principal-name run-as-role-assignment security-permission weblogic.xml Deployment Descriptors

3-26 Programming Security for Oracle WebLogic Server Example 3–13 Using the externally-defined tag in Web Application Deployment Descriptors web.xml entries: web-app ... security-role role-namewebuserrole-name security-role ... web-app weblogic.xml entries: weblogic-web-app security-role-assignment role-namewebuserrole-name externally-defined security-role-assignment For information about how to use the Administration Console to configure security for Web applications, see Securing Resources Using Roles and Policies for Oracle WebLogic Server.

3.5.2.2 run-as-principal-name

The run-as-principal-name element specifies the name of a principal to use for a security role defined by a run-as element in the companion web.xml file.

3.5.2.2.1 Used Within The run-as-principal-name element is used within a

run-as-role-assignment element.

3.5.2.2.2 Example For an example of how to use the run-as-principal-name

element, see Example 3–14 .

3.5.2.3 run-as-role-assignment

The run-as-role-assignment element maps a given role name, defined by a role-name element in the companion web.xml file, to a valid user name in the system. The value can be overridden for a given servlet by the run-as-principal-name element in the servlet-descriptor. If the run-as-role-assignment element is absent for a given role name, the Web application container chooses the first principal-name defined in the security-role-assignment element. The following table describes the elements you can define within a run-as-role-assignment element.

3.5.2.3.1 Example:

Example 3–14 shows how to use the run-as-role-assignment element to have the SnoopServlet always execute as a user joe. Table 3–8 run-as-role-assignment Element Element Required Optional Description role-name Required Specifies the name of a security role name specified in a run-as element in the companion web.xml file. run-as-principal-na me Required Specifies a principal for the security role name defined in a run-as element in the companion web.xml file. Securing Web Applications 3-27 Example 3–14 run-as-role-assignment Element Example web.xml: servlet servlet-nameSnoopServletservlet-name servlet-classextra.SnoopServletservlet-class run-as role-namerunasrolerole-name run-as servlet security-role role-namerunasrolerole-name security-role weblogic.xml: weblogic-web-app run-as-role-assignment role-namerunasrolerole-name run-as-principal-namejoerun-as-principal-name run-as-role-assignment weblogic-web-app

3.5.2.4 security-permission

The security-permission element specifies a security permission that is associated with a Java EE Sandbox.

3.5.2.4.1 Example For an example of how to used the security-permission

element, see Example 3–15 .

3.5.2.5 security-permission-spec