如何实现自定义 AWSCredentialsProvider?
How to implement custom AWSCredentialsProvider?
我需要将 CognitoCachingCredentialsProvider
替换为自定义 AWSCredentialsProvider
,以便为每个 IoT 请求添加自定义 headers,这可能吗?如何实现?
我当前的代码片段:
CognitoCachingCredentialsProvider credentialsProvider;
AWSIotDataClient iotDataClient = new AWSIotDataClient(credentialsProvider); iotDataClient.setEndpoint(AWSConstants.CUSTOMER_SPECIFIC_ENDPOINT);
GetThingShadowRequest request = new GetThingShadowRequest()
.withThingName(AWSConstants.TEMP_THING_NAME);
GetThingShadowResult result = iotDataClient.getThingShadow(request);
现在我想做的是用自定义 CredentialsProvider
替换 CognitoCachingCredentialsProvider
以在每个物联网请求中添加自定义 headers。
我的团队刚刚联系了 aws 支持,上面的问题不适用。
编辑:aws 团队正在努力,该功能将很快可用
我需要将 CognitoCachingCredentialsProvider
替换为自定义 AWSCredentialsProvider
,以便为每个 IoT 请求添加自定义 headers,这可能吗?如何实现?
我当前的代码片段:
CognitoCachingCredentialsProvider credentialsProvider;
AWSIotDataClient iotDataClient = new AWSIotDataClient(credentialsProvider); iotDataClient.setEndpoint(AWSConstants.CUSTOMER_SPECIFIC_ENDPOINT);
GetThingShadowRequest request = new GetThingShadowRequest()
.withThingName(AWSConstants.TEMP_THING_NAME);
GetThingShadowResult result = iotDataClient.getThingShadow(request);
现在我想做的是用自定义 CredentialsProvider
替换 CognitoCachingCredentialsProvider
以在每个物联网请求中添加自定义 headers。
我的团队刚刚联系了 aws 支持,上面的问题不适用。
编辑:aws 团队正在努力,该功能将很快可用