Questo contenuto non è disponibile nella lingua selezionata.
11.3. JAX-RS Application Security
11.3.1. Enable Role-Based Security for a RESTEasy JAX-RS Web Service
			RESTEasy supports the @RolesAllowed, @PermitAll, and @DenyAll annotations on JAX-RS methods. However, it does not recognize these annotations by default. Follow these steps to configure the web.xml file and enable role-based security.
		
Warning
Procedure 11.1. Enable Role-Based Security for a RESTEasy JAX-RS Web Service
- Open theweb.xmlfile for the application in a text editor.
- Add the following <context-param> to the file, within theweb-apptags:<context-param> <param-name>resteasy.role.based.security</param-name> <param-value>true</param-value> </context-param><context-param> <param-name>resteasy.role.based.security</param-name> <param-value>true</param-value> </context-param>Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
- Declare all roles used within the RESTEasy JAX-RS WAR file, using the <security-role> tags:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
- Authorize access to all URLs handled by the JAX-RS runtime for all roles:Copy to Clipboard Copied! Toggle word wrap Toggle overflow 
Role-based security has been enabled within the application, with a set of defined roles.
Example 11.12. Example Role-Based Security Configuration