【问题标题】:Get Credentials from Amazon Cognito in pure Java使用纯 Java 从 Amazon Cognito 获取凭证
【发布时间】:2017-08-31 10:55:08
【问题描述】:

如何在纯 Java 中仅使用 IDENTITY_POOL_ID 和 Region 从 Amazon Cognito Identity 获取 access key security key 和 session token 之类的凭据?

与 Android 类似,但没有应用程序上下文

CognitoCachingCredentialsProvider credentialsProvider = new CognitoCachingCredentialsProvider(
  getApplicationContext(), // Context
  "IDENTITY_POOL_ID", // Identity Pool ID
  Regions.US_EAST_1 // Region
);

是否可以使用 Amazon SDK for Java 或纯 Http 请求?如果是,我该怎么做?

【问题讨论】:

    标签: java android amazon-web-services amazon-cognito amazon-polly


    【解决方案1】:

    我找到了解决方案,CognitoCachingCredentialsProvider 扩展 CognitoCredentialsProvider 所以只需使用基类

    CognitoCredentialsProvider credentialsProvider = new CognitoCredentialsProvider(
                COGNITO_POOL_ID,
                MY_REGION
        );
    

    【讨论】:

      猜你喜欢
      • 2018-05-23
      • 2018-03-28
      • 2017-02-04
      • 1970-01-01
      • 2017-06-06
      • 2019-12-06
      • 2020-12-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多