Sign API Gateway Request with Android SDK

0

Greetings,

Is there documentation on how to make an HTTP request using the Android AWS SDK when the API Gateway endpoint uses an IAM Authorizer? Essentially, I need to sign the request with Signature V4 using AWS Credentials. I'm using Retrofit as the HTTP client but can swith to making the request using the SDK or other client if needed. I can't find any documentation which illustrates how to sign the request. In addition to documentation, are there any code samples available?

Many Thanks, Todd

1개 답변
0
수락된 답변

Hi - have you tried using the generated SDK for Android for your API? You generate that by going to the API Gateway console, go to your API, go to the stage you want to generate for (probably "Prod"), then the "SDK Generation" tab. You can choose Android as the platform.

The SDK will have generated classes for you to talk to your API (including if your API is set to use AWS_IAM for authorization), and the readme.md file will have samples.

Like so:

ApiClientFactory factory = new ApiClientFactory();
// create a client
final WebApiChallengeClient client = factory.build(WebApiChallengeClient.class);

Or, are you saying you are already using that generated SDK for your API, and still not working?

profile pictureAWS
Kirk_D
답변함 4년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠