使用标头中包含Bearer Token的URL创建订阅



你好,FIWARE专家,我喜欢创建一个订阅,它将通知推送到外部服务。外部服务需要使用屏障令牌进行授权。如果我使用卷曲--标题"授权:承载XXX";。如何向订阅请求添加屏障令牌?

"notification": {
"attributes": [ "id", "type", "name", "location", "occupancy"],
"format": "normalized",
"endpoint": { 
"uri": "http://a.b.c.de:1111", 
"accept": "application/json"
}
},

是否有将标题字段添加到";端点";订阅中的设置类似:

"headers": "Authorization: Bearer XXX"

希望你能在这种情况下帮助我。谢谢,Knigge

在Orion Context Broker中,使用NGSIv2 API,您可以使用自定义通知来实现这一点。例如以下订阅:

...
"httpCustom": {
"url": "http://context-provider:3000/subscription/low-stock-store001",
"headers": {
"Authorization": "Bearer XXX"
}
}

最新更新