AWS Api Gateway: Missing Authentication Token

人走茶凉 提交于 2020-01-15 10:25:32

问题


So i have a Custom Domain Name setup for api gateway linked to a lambda function. I have it working fine if i do https://api_domain.com/something the behavior is as expected.

Resource: /{proxy+} Base Path Mappings: /

But when i go to the root domain and try to display something for that url i can't get it to work

https://api_domain.com/

{"message":"Missing Authentication Token"}

Searching around i found;

The "Missing Authentication Token" error might be happening if you aren't adding the resource to your uri. For me, browsing to https://{api_domain}/{stage} results in that error. If you do https://{api_domain}/{stage}/{resource_name} then the error may disappear.

Is there a way to display something custom for the root domain or is the only option to display that ugly error?


回答1:


Add a method to the / root resource. As you have discovered the /{proxy+} doesn't match the root, you have to handle it separately.



来源:https://stackoverflow.com/questions/52909329/aws-api-gateway-missing-authentication-token

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!