Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open anonymous access to AWS API Gateway resource

I have a number of lambda functions exposed via the AWS Gateway Service as such:

- /some-resource
    GET
    POST
    OPTIONS
- /some-other-resource
    GET
    POST
    OPTIONS
- /some-public-resource
    GET
    OPTIONS

The resources are secured with Access Tokens. However, I would like to allow anonymous access to the /some-public-resource resource, so that it can be accessed without requiring any authentication.

I have tried to create a policy in IAM for that resource's ARN (although I am not sure that I got the Gateway API Resource ARN correct as I couldn't find any documentation on how to set this value), however, I am still unable to access that end-point without an access token.

Does anyone have an idea of whether or not there is an additional step I need to take, or if there is something else I have done wrong?

like image 612
ralfe Avatar asked Jan 14 '18 14:01

ralfe


People also ask

How do I access private API gateway?

You can access your private API using endpoint-specific DNS hostnames. These are public DNS hostnames containing the VPC endpoint ID or API ID for your private API. To use the Amazon Web Services Documentation, Javascript must be enabled.

How do I access API API gateway?

Sign in to the API Gateway console at https://console.aws.amazon.com/apigateway . Choose your API. Note your API's invoke URL. Copy your API's invoke URL, and enter it in a web browser.

How can Amazon API gateway be accessed?

Amazon API Gateway provides security using access keys to control API access. It works with AWS Identity and Access Management and Amazon Cognito to authorize access to APIs. The service also supports AWS Signature Version 4 as another security option; creating access keys for each API call.


1 Answers

You could disable any authorization and API key requirement from the console as follow:

This step must be applied to the whole set of methods (POST, PATCH, DELETE, and so on) in your resource /some-public-resource.

Click on Method Request link (invokeworker2 = some-public-resource)

enter image description here

Then, disable Authorization and API key Required

enter image description here

Like I said, you need to do that for every method in your resource /some-public-resource.

Now, your resource /some-public-resource is open and clients won't need to pass any tokens for authorization.

like image 132
Ele Avatar answered Oct 03 '22 16:10

Ele