REST authentication flow
REST services are authenticated in HCL Commerce on secure and unsecured channels.
The following diagram shows the REST authentication flow
for the REST and Web clients:

Where:

Where:
If the call is on a
secure channel:
- If the
WCTrustedToken
header is present, use theWCTrustedToken
header. - If the
WC_AUTHENTICATION_*
cookie is present and cookie usage is allowed for REST, use theWC_AUTHENTICATION_*
cookie matching the specified store ID. - If the
WC_PERSISTENT
cookie is present and cookie usage is allowed for REST, use theWC_PERSISTENT
cookie if persistent sessions are enabled for the service. Otherwise, an exception is thrown indicating that partial authentication is not allowed.
If the call is on an unsecure channel:
- If the
WCToken
header is present, use theWCToken
header. - If the
WC_USERACTIVITY_*
cookie is present and cookie usage is allowed for REST, use theWC_USERACTIVITY_*
cookie matching the specified store ID. Then, set theWC_USERACTIVITY_*
cookie in the response with an updated timeout value, only if the expiration is within the configured threshold to avoid updates on every request. - If the
WC_PERSISTENT
cookie is present and cookie usage is allowed for REST, use theWC_PERSISTENT
cookie if persistent sessions are enabled for the service. Otherwise, an exception is thrown indicating that partial authentication is not allowed.
Note: it is recommended to use cookies for authentication, so that persistent sessions are
enabled for shoppers to be remembered. For more information, see Enabling partial authentication and cookie-based authentication for REST services.