用途:指导在 SAP BTP Connectivity 中配置 Destination(目标),用于云应用与远程系统之间的通信,目标在运行时按符号名解析。
主要能力与认证选择:NoAuthentication 仅用于公共 API;BasicAuthentication 仅限开发/测试,禁止用于生产;OAuth2ClientCredentials 用于系统到系统、无用户上下文;OAuth2JWTBearer 用于同一子账户内的用户传播,优先于 OAuth2UserTokenExchange;OAuth2SAMLBearerAssertion 用于到本地部署或跨子账户的用户传播;OAuth2UserTokenExchange 仅在 JWTBearer 不可用时使用;PrincipalPropagation 用于经 Cloud Connector 的本地部署用户上下文。
使用方式:在 BTP Cockpit → Connectivity → Destinations 配置 Name、Type、URL、ProxyType、Authentication 及 clientId、clientSecret、tokenServiceURL 等字段。CAP 中在 package.json 的 cds.requires 下用 credentials.destination 引用目标,运行时自动解析;也可用 @sap-cloud-sdk/connectivity 的 getDestination 手动读取。本地测试可用 cds bind -2 绑定目标服务,再以 cds watch --profile hybrid 运行,或在 package.json 中按 [development] 配置本地模拟、[production] 使用真实目标。
限制与注意:本地部署目标需在 mta.yaml 中同时绑定 Destination Service 与 Connectivity Service,并依赖 Cloud Connector 的虚拟主机映射、子账户连接与 SNC 配置;避免在生产使用 BasicAuthentication、避免硬编码凭据、避免在可用 JWTBearer 时使用 UserTokenExchange。资料未提供具体收费与平台版本信息。