我正在尝试使用OAuth2.0机制连接到Google Home。但是,遇到无法获取成功消息的问题。
失败的请求是-https://oauthintegrations.googleapis.com/v1/token:getForService
响应有效载荷为redirectState
。我知道重定向,但是redirectState是什么?我试图对此进行搜索,但是失败了。
任何帮助将不胜感激。
注意:我已经执行了doc中提到的所有必要步骤,我可以收到授权代码,但无法向所需的端点发出令牌请求。
文档是https://developers.google.com/actions/identity/oauth2-code-flow和https://developers.google.com/actions/identity/account-linking。
在配置设置中,链接类型为Oauth->授权代码。
在集成->集成设置的对话框流中,我们已针对“默认欢迎意图”签入了“需要登录”,并且将firebase功能设置为
app.intent('Default Welcome Intent', (conv) => {
conv.ask(new SignIn());
});
根据https://developers.google.com/actions/identity/account-linking文档,我目前正在使用API版本V2。
收到提到的身份验证代码后,它不调用令牌网址,我们收到此屏幕:
身份验证交换中IdP的错误响应以及什么是redirect_state
如{rajesh所述,状态代码为400,检查https://gala-demo.appspot.com/app#redirect_state=XXX&state=yyy&service=abc时在https://oauthintegrations.googleapis.com/v1/token:getForService失败,但是通过邮递员提出此请求时,它将返回响应。这是请求的正文和响应。
身体:
{
"credential" : {
"redirectState": "XXX"
},
"scopes": [],
"gdiState": "APP_AUTH",
"serviceId": "tapclicks-integration-adac2_dev"
}
响应:
{
"serviceInfo": {
"authUrl": "https://-domain-/authorization",
"name": "tapclicks dashboard",
"logoUrl": "https://placeholder.com/",
"clientId": "zdqexVMaVvxIMQ7Frjwa",
"tokenUrl": "https://-domian-/token_url",
"privacyPolicyUrl": "https://placeholder.com/",
"tosUrl": "https://placeholder.com/",
"id": "tapclicks-integration-adac2_dev"
},
"completionInfo": {
"appauthInfo": {
"appauthRedirectUrl": "https://-domain-/authorization?response_type=code&client_id=zdqexVMaVvxIMQ7Frjwa&redirect_uri=https://oauth-redirect.googleusercontent.com/r/tapclicks-integration-adac2&scope=gmail&state=yyy",
"appauthRedirectState": "abcxxx"
},
"oauthAuthorizationUrl": "https://-domain-/authorization?response_type=code&client_id=zdqexVMaVvxIMQ7Frjwa&redirect_uri=https://oauth-redirect.googleusercontent.com/r/tapclicks-integration-adac2&scope=gmail&state=yyy"
},
"gdiState": "APP_AUTH",
"header": {}
}
您能告诉我我是否在配置错误或您需要的任何其他信息。
授权网址:https://kprb95tye7.execute-api.us-east-1.amazonaws.com/authorization/
令牌网址:https://9343j46f16.execute-api.us-east-1.amazonaws.com/token_url/
谢谢