You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在FIWARE订阅的请求头中添加Bearer Token实现授权

FIWARE订阅添加Bearer Token授权的正确方式

可以在订阅的endpoint配置中添加请求头实现Bearer Token授权,但你给出的格式不正确,需要使用JSON对象形式而非字符串。

正确的订阅notification部分配置如下:

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

FIWARE Context Broker的订阅规范中,endpoint下的headers字段要求是键值对结构的JSON对象:

  • 键为请求头的名称(比如Authorization)
  • 值为对应的请求头内容(比如Bearer XXX)

配置完成后,Context Broker向外部服务推送通知时,会自动携带这个Authorization请求头,满足外部服务的Bearer Token授权验证要求。

内容的提问来源于stack exchange,提问作者knigge

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.20 07:09:26