I am creating a custom controller for an SFCC Commerce Cloud (Demandware) store.
Because I need to have communication with Third-party systems, I created a custom REST API controller to be able to receive some data inside the SFCC.
I created a rest controller in order to receive information by POST. How can I provide an authentication mechanism for my controller?
The OCAPI provides resources that come protected by default and you can use OAuth for the authentication, but custom controllers are unprotected and I was wondering how to add OAuth or another authentication mechanism.
My controller:
server.post('Test', server.middleware.https, function (req, res, next) {
//Some logic that should be protected...
}