Assign users to RunAs roles
Before you begin
Before you perform this task, complete the following tasks:
- Secure the Web applications and EJB applications where new RunAs roles were created and assigned to Web and EJB resources.
- Create all the RunAs roles in your application. The user in the RunAs role can only be entered if that user or a group to which that user belongs is already part of the regular role.
- Assign users and groups to security roles. Refer to Assigning users and groups to roles for more information.
- Verify that the user registry requirements are met. These requirements are the same as those discussed in the same as in the case of Assigning users and groups to roles task. For example, if role1 is a role that is also used as a RunAs role, then the user, user1, can be added to the RunAs role. The administrative console checks this logic when Apply or OK is clicked. If the check fails, the change is not made and an error message displays at the top of the panel.
If the special subjects "Everyone" or "All Authenticated" are assigned to a role, then no check takes place for that role.
The checking is done every time Apply in this panel is clicked or when OK is clicked in the Map security roles to users/groups panel. The check verifies that all the users in all the RunAs roles do exist directly or indirectly (through a group) in those roles in the Map security roles to users/groups panel. If a role is assigned both a user and a group to which that user belongs, then either the user or the group (not both) can be deleted from Map security roles to users/groups panel.
If the RunAs role user belongs to a group and if that group is assigned to that role, make sure that the assignment of this group to the role is done through administrative console and not through an assembly tool or any other method. When using the administrative console, the full name of the group is used (for example, hostname\groupName in windows systems, and distinguished names (DN) in Lightweight Directory Access Protocol (LDAP)). During the check, all the groups to which the RunAs role user belongs are obtained from the registry. Since the list of groups obtained from the registry are the full names of the groups, the check works correctly. If the short name of a group is entered using an assembly tool (for example, group1 instead of CN=group1, o=myCompany.com) then this check fails.
Overview
These steps are common to both installing an application and modifying an existing application. If the application contains RunAs roles, you see the Map RunAs roles to users link during application installation and also during managing applications as a link in the Additional properties section at the bottom.
Procedure
- Click Applications > Enterprise Applications > appname.
- Under Additional properties, click Map RunAs roles to users. A list of all the RunAs roles that belong to this application displays. If the roles already had users assigned, they display here.
- To assign a user, select the role. We can select multiple roles at the same time if the same user is assigned to all the roles.
- Enter the user's name and password in the designated fields. The user name entered can be either the short name (preferred) or the full name (as seen when getting users and groups from the registry).
- Click Apply. The user is authenticated using the active user registry. If authentication is successful, a check is made to verify that this user or group is mapped to the role in the Map security roles to users and groups panel. If authentication fails, verify that the user and password are correct and that the active registry configuration is correct.
- To remove a user from a RunAs role, select the roles and click Remove.
Result
The RunAs role user is added to the binding file in the application. This file is used for delegation purposes when accessing J2EE resources. This step is required to assign users to RunAs roles so that during delegation the appropriate user is used to invoke the EJB methods.
What to do next
If you are installing the application, complete installation. Once the application is installed and running one can access your resources according to the RunAS role mapping. Save the configuration.If you are managing applications and have modified the RunAs roles to users mapping, make sure you save, stop and restart the application so that the changes become effective. Try accessing your J2EE resources to verify that the new changes are in effect.
See also
EJB 2.1 method protection level settings
RunAs roles to users mapping
Related Tasks
Assigning users and groups to roles
Security role to user and group selections