52.9. 配置组件并启用身份验证

要使用 Box 进行身份验证,如下例所示在组件上设置身份验证属性:

BoxConfiguration configuration = new BoxConfiguration();
configuration.setClientId("clientId");
configuration.setClientSecret("clientSecret");
configuration.setUserName("userName");
configuration.setUserPassword("userPassword");

// add BoxComponent to Camel context
BoxComponent component = new BoxComponent(context);
component.setConfiguration(configuration);
context.addComponent("box", component);