Operation-level security: Role-based authorization
When you build an EAR file, we can define roles and apply them to methods. When you deploy the EAR file, we can assign individual users or groups to roles. We can use this feature of EAR files to add role-based security to the web service. For example:
- You have a web service that controls access to important information, and to give read-only access to some users, and write access to others.
- When you build the EAR file you define two roles: READ and WRITE. You apply the READ role to the getData method and the WRITE role to the writeData method.
- When you deploy the EAR file in WebSphere Application Server, we assign All Authenticated Users to the READ role and individual users to the WRITE role.
- When a user tries to access WebService.getData, their user name and password is checked by the operating system or by LTPA.
Related tasks
Password-protecting a web service operation Use assembly tools to password-protect a web service operation Password-protecting a web service operation Use assembly tools to password-protect a web service operation