Securing REST services using Secure Sockets Layer (SSL)
There are some REST services that must be sent securely over Secure Sockets Layer (SSL). You can add an SSL requirement for new or existing REST services.
The Rest.war/WEB-INF/config/com.ibm.commerce.rest/wc-rest-security.xml file defines all the REST services that require SSL. In this file, resource URL prefixes are specified and all the requests that match the URL prefixes must be sent over HTTPS. Otherwise, an error response is generated.
Partial authentication is enabled by default
in the wc-rest-security.xml file, indicated by
the
partialAuthentication
flag. For example:
<security>
<partialAuthentication resource="store/{storeId}/wishlist" method="POST" enabled="true"/>
</security>
Where each resource listed as partialAuthentication=true
is
allowed to consume the partial authentication stored in the WC_PERSISTENT
cookie.
This configuration is only used if cookie consumption is allowed on
the REST API. The default value is false. When a service is called,
the service URL is matched with the resource patterns, starting with
the longest pattern, matching the behavior of the sslConfig
nodes
in the file.You can create your own wc-rest-security.xml file in the Rest.war/WEB-INF/config/com.ibm.commerce.rest-ext directory to add an SSL requirement for new or existing REST services.