Announcement: You can find the guides for Commerce 7.5 and later on the new Elastic Path Documentation site. The Developer Center continues to support Commerce 6.13.0 through 7.4.1.Visit new site

Security (Storefront)

Security (Storefront)

Elastic Path uses the Spring Security framework for user authentication and authorization. The security.xml file, which is located in ep-storefront\src\main\resources\spring\security, contains the security settings you need to configure.

Configuring the HTTPS port redirect

You can configure the application server to switch to the HTTPS port for pages that require it based on the request port number. In the security.xml, the <port-mapping> element's attributes http and https define the http and https ports. The following example shows how to redirect requests on port 8080 to port 8443:

<port-mappings>
      <port-mapping http="8080 " https="8443" />
    </port-mappings>

Enabling/Disabling SSL

Not all URLs need to be secure in your applications. Elastic Path pre-configured URLs for the Elastic Path Web Applications, see Spring Security Filters for this list. To configure SSL for specific URLs, locate the URL's <intercept-url> element in the security.xml and define https or http for the requires-channel attribute. For example, for Elastic Path Commerce, if you wanted to enable SSL for /checkout.ep* URLS, the <intercept-url> element would look like this:

<intercept-url pattern="/checkout.ep*" access="ROLE_CUSTOMER,ROLE_ANONYMOUS_CUSTOMER" requires-channel="https" />