我在尝试生成授权代码时收到授权错误:
Error 400: invalid_request
You can't sign in to this app because it doesn't comply with Google's OAuth 2.0 policy for keeping apps secure.
If you’re the app developer, make sure that these request details comply with Google policies. redirect_uri: urn:ietf:wg:oauth:2.0:oob
我已使用此 Google 教程来复制并确认该问题:
https://developers.google.com/assistant/sdk/guides/service/python/embed/install-sample?hl=en_US
它正在生成此 URL:
最佳答案
这是 jdtoth 在 Github 上提供的解决方法:https://github.com/greghesp/assistant-relay/issues/266#issuecomment-1065940698
谢谢jdtoth!
I found a workaround for creating a new user. In my case, I needed to create a specific type of API credential. Here is what I did:
Create a new OAuth Client credential using the link below, ensuring the application type is "Web application" and set Authorized Redirect URIs to "http://localhost"
https://console.cloud.google.com/apis/credentials
Download the key, and create the user in the Assistant Relay appas you tried before. When it opens a new browser window to authorize the google account, you might need to bypass a warning. After you do this, a blank browser window will open but the address bar will contain the auth code you need. Grab the code from the relevant part of the URL here and paste it back into the Assistant Relay app:
http://localhost/?code=COPYCODEFROMHERE&scope=https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fassistant-sdk-prototype
Let me know if this works. I am successfully sending commands to the Assistant Relay server but nothing is playing on my speakers.
关于oauth-2.0 - 生成凭据身份验证错误-redirect_uri,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71385860/