[英]Why am I still getting invalid_client error?
I am working on a Google Drive API tutorial 我正在研究Google Drive API 教程
I am currently on the part where you run the demo. 我目前正在运行演示。 When I visit the URL generated by the program, I get this error - "Error: invalid_client . The OAuth client was not found." 当我访问程序生成的URL时 ,出现以下错误-“错误:invalid_client。未找到OAuth客户端。”
Here is my code(subbed in my client_id and client_secret) 这是我的代码(在我的client_id和client_secret中添加了字幕)
public class DriveCommandLine {
private static String CLIENT_ID = "37895131772";
private static String CLIENT_SECRET = "laUVGRI53uXzT90Ag880HSkT";
private static String REDIRECT_URI = "urn:ietf:wg:oauth:2.0:oob";
....
I double checked the client_id and client_secret on the Developer's console to make sure those components were not the issue.(tutorial didn't say to replace redirect_uri) 我在开发人员控制台上仔细检查了client_id和client_secret以确保这些组件不是问题。(教程中没有说要替换redirect_uri)
Does anyone know what the issue is? 有人知道这个问题是什么吗? I checked this thread as well and the solution there was to set email and product name to the same name as the Eclipse project. 我也检查了该线程 ,解决方案是将电子邮件和产品名称设置为与Eclipse项目相同的名称。 I did both(my email and DriveTutorial, name of Eclipse project) but still I got the same error. 我都做到了(我的电子邮件和DriveTutorial,Eclipse项目的名称),但仍然出现相同的错误。
Are you using the correct client ID (sorry for asking but read below)? 您使用的是正确的客户ID(很抱歉,请稍后阅读)?
I just generated one and it looks like this: 826972360704-pc2l8e4bvvg7e4a64nen8ofdsk41c60p.apps.googleusercontent.com Your client ID looks like it is just the first numbers before the dash (unless you obfuscated it which is usually not needed since client id is considered public information) 我刚刚生成了一个,它看起来像这样:826972360704-pc2l8e4bvvg7e4a64nen8ofdsk41c60p.apps.googleusercontent.com您的客户ID看起来像是破折号前的第一个数字(除非您将其混淆,因为客户ID被认为是公共信息,所以通常不需要这样)
Also I tried calling following URL: 我也尝试调用以下URL:
https://accounts.google.com/o/oauth2/auth?access_type=online&approval_prompt=auto&client_id=897110948812-7nhm1mqpb8dekoalbl6go7appruttn01.apps.googleusercontent.com&redirect_uri=https://www.example.com/oauth2callback&response_type=code&scope=https://www.googleapis.com/auth/drive
And correctly got the OAuth "grant permission to application X" prompt. 并正确获得OAuth“对应用程序X的授予许可”提示。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.