- Newest
- Most votes
- Most comments
For guest access you should be using AWS_IAM
as authorizationType
. You may want to consider using multiple APIs set up with the same endpoint and different authorization mode in your amplifyconfiguration.json
. It will look like the following:
{
"awsAPIPlugin": {
"REST_AWS_IAM": {
"endpointType": "REST",
"endpoint": "<YOUR-REST-ENDPOINT>",
"region": "us-west-2",
"authorizationType": "AWS_IAM"
},
"REST_AMAZON_COGNITO_USER_POOLS": {
"endpointType": "REST",
"endpoint": "<YOUR-REST-ENDPOINT>",
"region": "us-west-2",
"authorizationType": "AMAZON_COGNITO_USER_POOLS"
}
}
}
The API name should be specified when invoking the API for each use-case. For example, you may do the following for guest access:
Amplify.API.post(
"REST_AWS_IAM",
options,
() -> {}, //success callback
() -> {} //error callback
);
Edited by: raphkim on Oct 5, 2020 3:34 PM
thanks for the help.
i managed to find the solution:
"When you make a call using temporary security credentials, the call must include a session token, which is returned along with those temporary credentials. AWS uses the session token to validate the temporary security credentials. The temporary credentials expire after a specified interval."
Relevant content
- Accepted Answerasked 3 days ago
- asked a year ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 10 months ago
- AWS OFFICIALUpdated 2 years ago