0
背景
我有一個EC2實例託管一個網站。該網站使用Google的OAuth2 API進行驗證(又名Google Identity Platform)。Google OAuth2不適用於Amazon EC2實例的公共DNS?
該實例具有類似http://ec2-99-99-99-99.compute-1.amazonaws.com
的公共DNS。
該URL已添加到憑證管理門戶中的「授權JavaScript起源」部分。
回到客戶端,用戶使用Google登錄按鈕小部件進行身份驗證。
問題
當谷歌小部件嘗試列出不同的登錄選項時,Google小部件失敗。對於新鮮登錄它看起來像這樣:
檢查網絡面板顯示此調用失敗:
https://accounts.google.com/o/oauth2/iframerpc?action=listSessions&client_id=...&origin=http%3A%2F%2Fec2-99-99-99-99.compute-1.amazonaws.com&scope=openid%20profile%20email&ss_domain=http%3A%2F%2Fec2-99-99-99-99.compute-1.amazonaws.com
{
"error" : "invalid_request",
"error_description" : "Permission denied to generate login hint for target domain."
}
調查說明
- 這不是一個SSL問題,因爲其他URL一樣
http://localhost:9000
工作精細。 - 這與
redirect_uri
不存在問題,因爲其他網址無法正常工作。