简体   繁体   中英

How to add the 'localhost' in Google Cloud Platform as an authorized domain for OAuth2

Question:

How do I add the Google Cloud public facing localhost to the authorized domains list so I can set up OAuth?

Background

I'm trying to follow this Google Dev tutorial on Building a Node.js Web App using Google Cloud Platform .

Some of the instructions seem slightly out of date, but I've managed to work around it so far. On Page 9, In section 'Setting OAuth 2.0 Client' step 9 (listed below) it says to paste in the URL https://8080-dot-<9 digit number>-dot-devshell.appspot.com/ with my 9 digit number replaced:

在此处输入图像描述

Problem

When I paste in the URI, I'm told that the URI needs to be added to the authorized domains list:

授权的重定向 URI - 无效的重定向

While that's not in the instructions, I went ahead and did as instructed. But every time it goes to 'verify' the domain, it keeps getting a rejection screen saying:

网站管理员中心 - 验证失败

So what on earth do I do here? It won't let me make the OAuth key without the verified domain, and it won't let me verify the domain.

I am guessing the "[...]-dot-devshell.appspot.com" url in 2017 used to forward directly to the web server you wanted to test.

This must have changed in the meantime to require authentication before accessing the web page. This is blocking the configuration of the OAuth since the URL redirects to a different website. This is why you are not able to finish the codelab.

What you could do is try a more recent codelab such as this one to practice with Node.js

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM