我正在实施Spring Integration for REST服务。我遵循XPadro的githib示例 - https://github.com/xpadro/spring-integration。Spring集成安全性与REST服务示例
我已经创建了简单的读取,写入和更新操作。 示例取自int-http-dsl
项目。
我想用誓言来实现spring-security。我正在参考http://docs.spring.io/spring-integration/reference/html/security.html。
我无法将两者连接在一起。因为下面是他们是如何映射请求
@Bean
public IntegrationFlow httpGetFlow() {
return IntegrationFlows.from(httpGetGate()).channel("httpGetChannel").handle("personEndpoint", "get").get();
}
@Bean
public MessagingGatewaySupport httpGetGate() {
HttpRequestHandlingMessagingGateway handler = new HttpRequestHandlingMessagingGateway();
handler.setRequestMapping(createMapping(new HttpMethod[]{HttpMethod.GET}, "/persons/{personId}"));
handler.setPayloadExpression(parser().parseExpression("#pathVariables.personId"));
handler.setHeaderMapper(headerMapper());
return handler;
}
以下是我们如何能够整合安全
@Bean
@SecuredChannel(interceptor = "channelSecurityInterceptor", sendAccess = "ROLE_ADMIN")
public SubscribableChannel adminChannel() {
return new DirectChannel();
}
我不能找到一种方法来创建第一个示例通道,因此如何整合这一点。
我正确的方向还是错了?
有没有更好的教程来处理spring-integration(http)与spring-security(使用oauth)?