Java 什么是“授权回调网址”?对于 imgur,我的应该是什么?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/21806816/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-13 10:46:41  来源:igfitidea点击:

What is an "authorization callback url?" for imgur and what should mine be?

javaimgurcallbackurl

提问by user2816570

I'm trying to write a program to upload an image to imgur and return the url. I want to start trying to play around with the api, but to register for my client id, one of the required fields is the "Authorization callback url." The description says "The callback URL is used to determine where Imgur redirects the user after they authorize your access request..."

我正在尝试编写一个程序将图像上传到 imgur 并返回 url。我想开始尝试使用 api,但要注册我的客户端 ID,必填字段之一是“授权回调 url”。描述说“回调 URL 用于确定 Imgur 在用户授权您的访问请求后将用户重定向到哪里......”

My program would be in the command line in java, or perhaps an android application. From what I understand (which is probably wrong), this would be useful for a web application, but for general use of the api, doesn't seem to help with anything. Especially if I'm working in the command line. Is there perhaps a "default" url or something I can put in? Or am I misunderstanding the purpose of the callback url?

我的程序将在 java 的命令行中,或者可能是一个 android 应用程序。据我了解(这可能是错误的),这对 Web 应用程序很有用,但对于 api 的一般使用,似乎没有任何帮助。特别是如果我在命令行中工作。是否有“默认”网址或我可以输入的内容?还是我误解了回调 url 的目的?

回答by identicon

Your definition of the callback URL is correct. Some applications, such as a CLI, don't need a callback URL, and imgur allows you to not provide one. When registering your client, choose the option OAuth 2 authorization without a callback URLunder Authorization type.

您对回调 URL 的定义是正确的。某些应用程序,例如 CLI,不需要回调 URL,而 imgur 允许您不提供回调 URL。当注册客户端,选择的选项OAuth 2 authorization without a callback URLAuthorization type

It's been a long time and the asker has probably moved on, but I'm new when it comes to using APIs and I stumbled on this question looking for the same answer. Hopefully, this reply will help you.

已经很长时间了,提问者可能已经离开了,但是在使用 API 方面我是新手,我偶然发现了这个问题,正在寻找相同的答案。希望这个回复能帮到你。