11.7. REST Interface Security
11.7. REST Interface Security 11.7.1. Publish REST Endpoints as a Public Interface Red Hat JBoss Data Grid's REST server operates as a management interface by default. To extend its operations to a public interface, alter the value of the interface parameter in the socket-binding element from management to public as follows: Report a bug 11.7.2. Enable Security for the REST Endpoint Use the following procedure to enable security for the REST endpoint in Red Hat JBoss Data Grid. Note The REST endpoint supports any of the JBoss Enterprise Application Platform security subsystem providers. Procedure 11.2. Enable Security for the REST Endpoint To enable security for JBoss Data Grid when using the REST interface, make the following changes to standalone.xml : Specify Security Parameters Ensure that the rest endpoint specifies a valid value for the security-domain and auth-method parameters. Recommended settings for these parameters are as follows: Check Security Domain Declaration Ensure that the security subsystem contains the corresponding security-domain declaration. For details about setting up security-domain declarations, see the JBoss Enterprise Application Platform 6 documentation. Add an Application User Run the relevant script and enter the configuration settings to add an application user. Run the adduser.sh script (located in USDJDG_HOME/bin ). On a Windows system, run the adduser.bat file (located in USDJDG_HOME/bin ) instead. When prompted about the type of user to add, select Application User (application-users.properties) by entering b . Accept the default value for realm ( ApplicationRealm ) by pressing the return key. Specify a username and password. When prompted for a group, enter REST . Ensure the username and application realm information is correct when prompted and enter "yes" to continue. Verify the Created Application User Ensure that the created application user is correctly configured. Check the configuration listed in the application-users.properties file (located in USDJDG_HOME/standalone/configuration/ ). The following is an example of what the correct configuration looks like in this file: Check the configuration listed in the application-roles.properties file (located in USDJDG_HOME/standalone/configuration/ ). The following is an example of what the correct configuration looks like in this file: Test the Server Start the server and enter the following link in a browser window to access the REST endpoint: Note If testing using a GET request, a 405 response code is expected and indicates that the server was successfully authenticated. Report a bug
<socket-binding name="http" interface="public" port="8080"/> <subsystem xmlns="urn:infinispan:server:endpoint:6.1"> <rest-connector virtual-server="default-host" cache-container="local" security-domain="other" auth-method="BASIC"/> </subsystem> user1=2dc3eacfed8cf95a4a31159167b936fc user1=REST http://localhost:8080/rest/namedCache