【发布时间】:2019-02-20 01:06:37
【问题描述】:
我正在使用the new Action on Google Java API 构建一个应用程序。据我了解处理 Alexa 中的帐户链接,初始流程(当 JSON 请求中的 userId 为 null 时)应重定向到登录表单以征求用户同意:
@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 不将我重定向到那里?
有人可以指导我如何在帐户链接流程中进行此初始握手,我在哪里可以看到从网络挂钩发送的登录意图应该触发的表单?
我宁愿不使用我的手机,因为错误消息似乎表明,因为我在 AoG 模拟器中测试的帐户与我在手机上的用户 ID 不同。
使用Simulator as a Speaker 是什么意思?我的设置中缺少什么?
有没有其他类似Alexa's simulator的谷歌应用可以更好的模拟物理设备?
【问题讨论】:
标签: oauth-2.0 actions-on-google alexa-skills-kit account-linking