我可以使用 Java 为 LinkedIn 开发桌面应用程序吗?
我想知道是否可以使用 Java 为 LinkedIn 开发桌面应用程序。我知道它可以很容易地作为一个网络应用程序来完成,但是一个完全的桌面应用程序,可能吗? 我查看了 linkedin api 和 LinkedIn 的 Java 包装器。 该代码是针对 Web 应用程序进行解释的。我如何在java桌面应用程序中管理它,特别是授权部分? 使用 Swing 进行 oAuth?
请以正确的方式指导我。
I was wondering if I can develop a Desktop App for LinkedIn using Java. I know it can be done as a web application easily, but a completely desktop application, is it possible?
I had a look at the linkedin api's and Java Wrapper for LinkedIn.
The code was explained for a web application. How do I manage that in a java desktop app, specifically the authorization part?
oAuth using Swing?
Please direct me in the right way.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
经过很长时间的 oAuth(使用我自己的包装器)测试后,我选择了 Scribe,它是几乎所有 oAuth 机制的 Java 包装器。要将 Linkedin 包含在桌面客户端中,正如 Adam Trachtenberg(再次感谢您)建议的那样,使用了 oob 选项,即登录后,必须在我们的客户端中输入 linkedin 生成的代码,以便可以根据请求进行验证网址。希望这对某人有用。
BareBonesBrowserLaunch
用于在大多数操作系统中通过 Linkedin URL 启动默认浏览器以进行令牌请求。由于Desktop
部分在 Java 1.5 中不可用,因此BareBonesBrowserLaunch
解决了该问题。LinkedInExample
大部分取自此库 - https://github.com /fernandezpablo85/scribe-java/downloads不要忘记包含 Scribe jar 和 apache commons-codec(用于
Base64
)After a very long time of testing with oAuth (with my own wrappers), I settled for Scribe which is a Java Wrapper for almost all oAuth mechanisms. To include Linkedin in a Desktop client, as Adam Trachtenberg (Thank you again) suggested, oob option was used, i.e., after logging in, a code generated by linkedin has to be entered in our Client so that it can be validated against the requested url. Hope this is useful for someone.
The
BareBonesBrowserLaunch
is used to launch the default browser with the Linkedin URL for the token request in most OS's. Since theDesktop
part is not available in Java 1.5, theBareBonesBrowserLaunch
solves the problem.The
LinkedInExample
is taken mostly from this library - https://github.com/fernandezpablo85/scribe-java/downloadsDon't forget to include the Scribe jar and apache commons-codec (for
Base64
)是的,您可以,这一切都是为了使用 API 并利用 LinkedIn API 中包含的 Web 服务。
然而,整个过程必须通过使用 HTTP 请求等并解析响应以将其呈现在 JForm 上来实现。
编辑:啊!你是完全独立的:-) 感谢 XML..
Yes you can it's all about playing with the API and utilizing the web services packed within the LinkedIn's API.
However, the entire process has to be implemented by using the HTTP requests etc and by parsing the response to render it on the JForm.
EDIT: Ahh! you are totally independent :-) thanks to XML..
如果您不知道如何将用户重定向到 Web 浏览器并将浏览器重定向回您的应用程序,请查看 OAuth 回调的“越界”(又名“oob”)选项。这将在成员授权您的应用程序后向其显示一个代码,他们可以将其输入到您的 Java 应用程序中。
If you can't figure out how to redirect the user to a web browser and have the browser redirect back to your application, check out the "out of bounds" (aka "oob") option for the OAuth callback. This will display a code to the member after they authorize your application, which they can type into your Java app.