简体   繁体   English

为什么我仍然收到invalid_client错误?

[英]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.

相关问题 为什么我仍然收到NumberFormatException错误? - why am i still getting an error of NumberFormatException? 尝试撤销 Spring 授权服务器中的访问令牌时出现 invalid_client 错误 - Getting invalid_client error when trying to revoke an access token in Spring Authorization Server 为什么我仍在获取类没有有效的构造函数错误 - why am I still getting class has no valid constructor error Keycloak错误invalid_client仅允许承载 - Keycloak error invalid_client Bearer only not allowed 发送okhttp请求时:HTTP错误405和invalid_client - When sending okhttp request: HTTP ERROR 405 and invalid_client 为什么我在 Cloudinary Java 上收到“无效签名”错误? - Why am I getting an 'Invalid Signature' error on Cloudinary Java? 我可以在项目的资源文件夹中看到图像,但我仍然收到无效的网址错误 - I can see the image in my project's resource folder but I am still getting an invalid url error invalid_client 用于使用苹果登录 - invalid_client for sign in with apple 我正在尝试启动 Mozilla,但仍然收到此错误 - I am trying to launch Mozilla but still I am getting this error 我在来自Java客户端的Http Post请求上收到无效的参数错误 - I am getting a invalid parameter error on a Http Post request from a java client
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM