我正在为 SFCC Commerce Cloud (Demandware) 商店创建自定义控制器。
因为我需要与第三方系统进行通信,所以我创建了一个自定义 REST API 控制器,以便能够在 SFCC 中接收一些数据。
我创建了一个休息控制器,以便通过 POST 接收信息。如何为我的控制器提供身份验证机制?
OCAPI 提供了默认受保护的资源,您可以使用 OAuth 进行身份验证,但自定义控制器不受保护,我想知道如何添加 OAuth 或其他身份验证机制。
我的控制器:
server.post('Test', server.middleware.https, function (req, res, next) {
//Some logic that should be protected...
}