Google 模拟器上的 Actions 中的帐户链接重定向

Account Linking redirect in Actions on Google simulator

我正在使用 the new Action on Google Java API 构建应用程序。据我在处理 Alexa 中的帐户链接时了解到,初始流程(当 JSON 请求中的 userIdnull 时)应该重定向到登录表单以征得用户同意:

    @ForIntent("RawText")
    public ActionResponse launchRequestHandler(ActionRequest request) {

       String userId = request.getAppRequest().getUser().getUserId();
       String queryText = request.getWebhookRequest().getQueryResult().getQueryText();

       String speech = null;

            ResponseBuilder responseBuilder = getResponseBuilder(request);

            if (isBlank(userId) || GREETING.equalsIgnoreCase(queryText)) {

                speech = "I've sent a link to your Google Assistant app that will get you started and set up in just several simple steps.";

                responseBuilder.add(
                    new SignIn()
                        .setContext(speech));
                //...
                return responseBuilder.build();

但是,在 AoG 模拟器中进行测试时,我没有看到进行任何重定向。我看到以下错误:

我的帐户链接设置:

授权 URL 重定向到本地模拟授权服务,该服务应该显示登录表单。它是可访问的(通过 localhost 和 ssh 隧道,在这种情况下由 serveo.net 反向代理提供)。为什么 Google 没有将我重定向到那里?

有人可以指导我如何在帐户链接流程中进行初始握手吗?我在哪里可以看到从网络挂钩发送的登录意图应该触发的表单?

我不想使用我的 phone,正如错误消息似乎暗示的那样,因为我在 AoG 模拟器中测试的帐户与我在 phone 上的用户 ID 不同.

使用Simulator as a Speaker是什么意思?我的设置中缺少什么?

是否有另一个 Google 应用程序可以更好地模拟物理设备,类似于 Alexa's simulator

一般情况下,你可以模拟账户linking,通过选择调试选项卡,在那里你会找到一个url,将它复制粘贴到另一个选项卡上,你可以link 您的帐户。 linking 完成后,转到模拟器并输入 'cancel' 或 'stop',然后输入 'Talk to speech bank'。

!不要按重置或更改版本,否则您必须重新link您的应用程序

但是,最近 Google 从调试选项卡中删除了这个 url,我在任何地方都找不到它...

Simulator as a Speaker,Surface Dropdown设置为Phone,你需要select Speaker,

但是当你尝试那个时,你会收到这个错误...

Invocation Error
You cannot use standard Google Assistant features in the Simulator. If you want to try them, use Google Assistant on your phone or other compatible devices. 

因此目前,您无法使用模拟器测试需要帐户 linking 的 Action。你可以用你的智能手机来做...

2019-03-05 更新:

Google 已在模拟器中添加帐户 linking,现在更易于测试。