JavaFX + OAuth
By Rakesh Menon on Apr 15, 2010
As usual will start off with Wikipedia - OAuth (Open Authorization) - is an open standard that allows users to share their private resources (e.g. photos, videos, contact lists) stored on one site with another site without having to hand out their username and password. With more and more services moving to OAuth model, I think we need to try to have a generic implementation. Here is an attempt...
I prefer not to duplicate all those details available in various resources, so suggest to read few articles if you are not familiar with concepts of OAuth. Yahoo has a very detailed article outlining the flow of OAuth authorization or Beginner's Guide to OAuth from Hueniverse. Please refer to same for more info..
<script src="http://dl.javafx.com/1.2/dtfx.js"></script><script src="http://javafxdemos.googlecode.com/hg/resource/JavaFXOAuth/JavaFXOAuth.js"></script>
First enter oauth_consumer_key and oauth_secret_key, click "Request Token" button. If key is proper, you will receive a message in log with a URL. Copy and paste that URL in browser and follow the instructions. Once you grant access to your application, it will return a number. Copy the number and paste it as oauth_verifier. Now click on "Access Token" button. It will return you oauth_token and oauth_token_secret which can be used for all subsequent communication.
Yes its a bit difficult to understand the overall flow and implementation. I have tried my best to simplify it. The API may be simplified a bit more. I have signed up for contributing to JFXtras long time back, but haven't done anything yet. My objective was to pull in the various parsers that are used in different samples and create a library. I think all these can be incorporated into that...
Refer to LinkedInAPI.fx to get an idea on how we can extend the implementation to have fulll fledged support.
Please try it out and let me know your suggestions and feedback..