在AWS上托管时,拒绝为目标域生成登录提示的权限

时间:2018-04-11 15:41:39

标签: google-api google-oauth google-signin

网站链接可帮助您进行问题排查:http://ec2-54-227-148-233.compute-1.amazonaws.com/architect/

我正在尝试在自己的服务器上启动Anyplace Architect。我已经进入谷歌开发者控制台并设置我的密钥和放大器授权JavaScript来自我的网站,但当我访问该网站时,我得到以下内容:

enter image description here

在开发者控制台中,我看到:

Request URL:https://accounts.google.com/o/oauth2/iframerpc?action=listSessions&client_id=964916910124-bv0kcgd7lrbhblvc0okebbhahitnnerl.apps.googleusercontent.com&origin=http%3A%2F%2Fec2-54-227-148-233.compute-1.amazonaws.com&scope=openid%20profile%20email&ss_domain=http%3A%2F%2Fec2-54-227-148-233.compute-1.amazonaws.com
Request Method:GET
Status Code:400 
Remote Address:10.15.8.202:8080
Referrer Policy:no-referrer-when-downgrade

当我在本地午餐时,它运行得很完美,我甚至都没有在chrome的开发者控制台的网络选项卡中看到该请求。

enter image description here

localhost:5000& AWS网站位于Google认可的列表中

enter image description here

更新:

这可能只是我对登录工具如何工作的无知,但我已经能够找到对localhost和我的托管环境的调用是不同的。 localhost地址发送到google.com/signin/oauth/oauthchooseaccount:

https://accounts.google.com/signin/oauth/oauthchooseaccount?client_id=964916910124-bv0kcgd7lrbhblvc0okebbhahitnnerl.apps.googleusercontent.com&as=woofRlZRVjxqKYzi0Xbttw&destination=http%3A%2F%2Flocalhost%3A5000&approval_state=!ChRhQmpLNEZRVHZJVEo2TW4xUHZwbhIfd3hHcnJMMDRJYlVkMEs2dFEwd1Nsa3YxeWR4ZUt4WQ%E2%88%99AB8iHBUAAAAAWs-i2_Lj-7nWLqvZjcwt3RArM0a3r6wB&xsrfsig=AHgIfE9BSG8q4mj-GBLin4PQT5-zv5fhhQ&flowName=GeneralOAuthFlow

托管时转到google.com/o/oauth2/auth

https://accounts.google.com/o/oauth2/auth?redirect_uri=storagerelay%3A%2F%2Fhttp%2Fec2-54-227-148-233.compute-1.amazonaws.com%3Fid%3Dauth422135&response_type=code%20permission%20id_token&scope=openid%20profile%20email&openid.realm=&client_id=964916910124-bv0kcgd7lrbhblvc0okebbhahitnnerl.apps.googleusercontent.com&ss_domain=http%3A%2F%2Fec2-54-227-148-233.compute-1.amazonaws.com&access_type=offline&include_granted_scopes=true&prompt=consent&origin=http%3A%2F%2Fec2-54-227-148-233.compute-1.amazonaws.com&gsiwebsdk=2

1 个答案:

答案 0 :(得分:1)

我在 ec2网址时遇到了同样的问题,它在本地主机上正常工作。

这就是您可以做的。

  1. 获取IP地址-(最好是弹性IP,因为每次重新启动时ec2 IP都会更改)。

  2. 使用魔术域-xip.io或nip.io 例如您的IP地址11.12.0.0变为=> http://11.12.0.0.xip.iohttp://11.12.0.0.nip.io

  3. 在Google和您的浏览器中使用以上地址。

欢呼