Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/208.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/amazon-web-services/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在Android应用程序的AWS API网关中启用CORS_Android_Amazon Web Services_Security_Cors_Aws Api Gateway - Fatal编程技术网

如何在Android应用程序的AWS API网关中启用CORS

如何在Android应用程序的AWS API网关中启用CORS,android,amazon-web-services,security,cors,aws-api-gateway,Android,Amazon Web Services,Security,Cors,Aws Api Gateway,如何在AWS API Gateway中启用CORS,以便只有我的应用程序可以连接到API?添加您的域名,而不是“*”,如下所示: 'Access-Control-Allow-Origin': 'www.example.com' 如果您正在寻找身份验证,CORS可能不是正确的选择。此外,如果javascript没有在域(如网站)上运行,则无法限制域 对于身份验证,您应该尝试API网关中提供的IAM Auth。你所要做的就是在每个请求上签名。如何在android应用程序中做到这一点

如何在AWS API Gateway中启用CORS,以便只有我的应用程序可以连接到API?

添加您的域名,而不是“*”,如下所示:

 'Access-Control-Allow-Origin': 'www.example.com'

如果您正在寻找身份验证,CORS可能不是正确的选择。此外,如果javascript没有在域(如网站)上运行,则无法限制域


对于身份验证,您应该尝试API网关中提供的IAM Auth。你所要做的就是在每个请求上签名。

如何在android应用程序中做到这一点