问题描述:

I want to integrate webservice using API Gateway, I referred this and followed all steps carefully but From Step: 7 I have no any idea how to pass the parameter using AWS API Gateway, Anyone can help to solve this? I stuck in it till many days. Please help to solve this.

网友答案:

You only need to use the Access key and Secret Access Key if your API method has Authorization set to AWS_IAM.

It is not recommended to use your Access key and Secret Access Key as credentials from within an Android application since that requires distributing your credentials along with your app, making it easy for people to extract your credentials from the deploy app binary and using them for nefarious purposes.

Many application developers prefer to have the application authenticate via a Cognito identity pool. This is documented in step 8 here.

If this doesn't work for you, you should be able to use any of the classes which implement the AWSCredentialsProvider interface. These are documented here. You set the credentials provider on your ApiClientFactory instance using the credentialsProvider method, like so:

ApiClientFactory factory = new ApiClientFactory()
  .endpoint("https://localhost/")
  .credentialsProvider(credentialsProvider);

Again, I want to stress that you should never distribute your Access key and Secret Access Key with your application.

相关阅读:
Top