我可以实现 Google 登录到 AWS S3 上托管的 Web 应用程序吗?
Can I implement Google Sign-in into a web app hosted on AWS S3?
我实现了 Google 登录到我的 Angular 应用程序,按照这里的教程:https://developers.google.com/identity/sign-in/web/。
它在本地主机上运行良好。现在我正尝试在 AWS S3 存储桶上托管我的 Angular 应用程序。我在 Google 开发人员控制台中允许了 S3 存储桶的根目录 url。 Google 登录按钮在那里,但每当我点击时,我都会收到以下错误:
400. That’s an error.
Error: invalid_request
Application: xx Demo
You can email the developer of this application at: ...
Permission denied to generate login hint for target domain.
Request Details
openid.realm=
scope=email profile openid
response_type=permission
redirect_uri=storagerelay://http/s3-us-west-2.amazonaws.com?id=auth...
ss_domain=http://s3-us-west-2.amazonaws.com
client_id=.....apps.googleusercontent.com
fetch_basic_profile=true
我找到了这个 post here。它说
When using Amazon S3, though, it is not possible to protect your
website because the content is purely static. This means you can't
have a login page on the front end. With the service, you can either
make your objects either absolutely public — so that anyone can see
them online — or assign access rights to them — but only for users
connected through RESTful API.
这是否意味着如果我在 S3 存储桶上托管此应用程序,我将无法使用 Google 登录按钮?
我以前从未部署过任何东西。我真的很感激一些见解。谢谢。
即使您在 S3 上托管网站,也可以实施 Google 登录。您将不得不公开一些信息,例如客户端令牌,但在 Google API 控制台上,您将限制对 API 的访问仅限于您的域。
当您说在 Google API 控制台中允许 S3 存储桶的根端点时,您指的是实际存储桶 url 还是 URL当您允许静态网站托管时,存储桶会给您什么?您应该使用静态网站托管 url.
我实现了 Google 登录到我的 Angular 应用程序,按照这里的教程:https://developers.google.com/identity/sign-in/web/。 它在本地主机上运行良好。现在我正尝试在 AWS S3 存储桶上托管我的 Angular 应用程序。我在 Google 开发人员控制台中允许了 S3 存储桶的根目录 url。 Google 登录按钮在那里,但每当我点击时,我都会收到以下错误:
400. That’s an error.
Error: invalid_request
Application: xx Demo
You can email the developer of this application at: ...
Permission denied to generate login hint for target domain.
Request Details
openid.realm=
scope=email profile openid
response_type=permission
redirect_uri=storagerelay://http/s3-us-west-2.amazonaws.com?id=auth...
ss_domain=http://s3-us-west-2.amazonaws.com
client_id=.....apps.googleusercontent.com
fetch_basic_profile=true
我找到了这个 post here。它说
When using Amazon S3, though, it is not possible to protect your website because the content is purely static. This means you can't have a login page on the front end. With the service, you can either make your objects either absolutely public — so that anyone can see them online — or assign access rights to them — but only for users connected through RESTful API.
这是否意味着如果我在 S3 存储桶上托管此应用程序,我将无法使用 Google 登录按钮?
我以前从未部署过任何东西。我真的很感激一些见解。谢谢。
即使您在 S3 上托管网站,也可以实施 Google 登录。您将不得不公开一些信息,例如客户端令牌,但在 Google API 控制台上,您将限制对 API 的访问仅限于您的域。
当您说在 Google API 控制台中允许 S3 存储桶的根端点时,您指的是实际存储桶 url 还是 URL当您允许静态网站托管时,存储桶会给您什么?您应该使用静态网站托管 url.