Google Home的oAuth页面在Alpha版本中运行正常,但在Beta/Production版本中为空白。

huangapple go评论110阅读模式
英文:

Google Home oAuth page blank in Beta/Production but works fine in Alpha

问题

我们已经创建了一个Google Home Action,它在Alpha中运行得非常完美。它通过了所有的测试,oauth也正常工作。

然而,当我们尝试发布到生产环境时,已经被拒绝了4次,因为“oAuth页面是空白的”。

我现在将oAuth页面简化为最简单的HTML,没有JavaScript,限制了CSS,但我们仍然被拒绝。

Google Home Actions团队无法分享任何日志或错误信息,我们在检查服务器日志时也找不到任何问题。有人能提出调试此问题的任何方法吗?

以下是oauth页面的HTML代码:

<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Link COMPANY NAME to Google</title>
    <style>
        body {
            padding: 40px;
            margin: auto;
            font-family: Arial;
            text-align: start;
        }

        .header {
            padding: 8px;
            text-align: center;
        }

        .instructions {
            text-align: center;
            margin: auto;
            align-items: start;
        }

        .text_form {
            text-align: center;
            margin: auto;
            align-items: start;
        }

        .submit {
            background-color: rgb(0, 51, 255);
            padding: 12px 24px;
            margin: 4px;
            border: none;
            color: white;
            font-weight: bold;
        }
    </style>
</head>

<body>
    <div class="header">
        <div class="brandingLogo"><img src="/COMPANY-logo.png" /></div>
    </div>
    <div class="content">
        <div class="instructions">
            <p>By entering the pin, you are authorizing Google to control your devices.</p>
        </div>
        <div class="text_form">
            <form action="/oauth" method="post">
                <label for="text">Enter pin:</label>
                <input type="text" id="text" name="text">
                <input type="hidden" name="redirect_uri" value="${url}">
                <input type="hidden" name="state" value="${state}">
                <br></br>
                <input type="submit" class="submit" value="Agree and link">
            </form>
        </div>
</body>

</html>

我们的Express CORS设置如下:

app.use(cors({
    origin: '*'
}));

有人能提供帮助吗?

英文:

We have created a Google Home Action and it works perfectly in Alpha. It passes all the tests and the oauth works.

However when we try and release to production the have been rejected the past 4 times because the "oAuth page is blank".

I've now reduced the oAuth screen to the most simple html, no javascript, limited css, and we have still been rejected.

The Google Home Actions team lack the ability to share any logs or errors and we cannot find any issues when checking the server logs. Can anyone suggest any way of debugging this issue?

Here is the html of the oauth page:

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
&lt;meta charset=&quot;utf-8&quot;&gt;
&lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1, shrink-to-fit=no&quot;&gt;
&lt;title&gt;Link COMPANY NAME to Google&lt;/title&gt;
&lt;style&gt;
body {
padding: 40px;
margin: auto;
font-family: Arial;
text-align: start;
}
.header {
padding: 8px;
text-align: center;
}
/* .contentHeader {
text-align: center;
} */
.instructions {
text-align: center;
margin: auto;
align-items: start;
}
.text_form {
text-align: center;
margin: auto;
align-items: start;
}
.submit {
background-color: rgb(0, 51, 255);
padding: 12px 24px;
margin: 4px;
border: none;
color: white;
font-weight: bold;
}
&lt;/style&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;div class=&quot;header&quot;&gt;
&lt;div class=&quot;brandingLogo&quot;&gt;&lt;img src=&quot;/COMPANY-logo.png&quot; /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;content&quot;&gt;
&lt;div class=&quot;instructions&quot;&gt;
&lt;p&gt;By entering the pin, you are authorizing Google to control your devices.&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&quot;text_form&quot;&gt;
&lt;form action=&quot;/oauth&quot; method=&quot;post&quot;&gt;
&lt;label for=&quot;text&quot;&gt;Enter pin:&lt;/label&gt;
&lt;input type=&quot;text&quot; id=&quot;text&quot; name=&quot;text&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;redirect_uri&quot; value=&quot;${url}&quot;&gt;
&lt;input type=&quot;hidden&quot; name=&quot;state&quot; value=&quot;${state}&quot;&gt;
&lt;br&gt;&lt;/br&gt;
&lt;input type=&quot;submit&quot; class=&quot;submit&quot; value=&quot;Agree and link&quot;&gt;
&lt;/form&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;

Our express CORS settings are as follows:

app.use(cors({
origin: &#39;*&#39;
}));

Can anyone help?

答案1

得分: 0

  • 你可以尝试使用洗衣机 Codelab,并参考那里的OAuth实现,然后根据你的需求尝试实现它。

  • 你也可以使用NodeJS实现的 OAuth

英文:
  • You can try using the Washer Codelab and refer the implementation of OAuth from there and try implementing it as per your need.

  • You can also make use of the NodeJS implementation of OAuth.

答案2

得分: 0

经过几周的延迟,我们的行动没有任何更改地发布了。我坚信这是内部流程出现了问题。

英文:

After a few weeks of delay our Action was published without any changes. I honestly think there was an internal process failure.

huangapple
  • 本文由 发表于 2023年8月9日 09:34:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76864034-2.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定