Spring 集成:通过 oAuth 使用出站网关调用 REST 端点?

Spring Integration: call REST endpoint using outbound gateway with oAuth?

我一直在使用 SI 出站网关来调用使用 NTLM(Microsoft Dynamics 后端)保护的 REST 端点。这很简单,只需将 HttpComponentsMessageSender 凭据配置为使用 Apache HttpClient 的 NTCredentials,它就可以透明地工作。

然而,现在他们已经用 ADFS 保护它,这需要 oAuth 2.0 身份验证。我知道 Apache HttpClient(这是 SI / Rest 模板在较低级别使用的)不支持开箱即用的 oAuth,没有 oAuth AuthScheme。 在oauth.net上实现的oAuth 1.0 AuthScheme,但正如我所说,我需要oAuth 2.0。

所以我想我要问的是,有人知道可以插入 Apache HttpClient 以与 SI 一起使用的 oAuth 2,0 AuthScheme 吗?或者,是否可以以某种方式插入 Google's oAuth client?

<int-http:outbound-gateway> 支持用于注入 RestTemplate 实现的 rest-template 属性。

所以,考虑使用Spring Security OAuth project and its OAuth2RestTemplate