项目作者: MaxAndersonRHUL

项目描述 :
Utilising JavaFX WebViews to access Google and Facebook apis with OAuth
高级语言: Java
项目地址: git://github.com/MaxAndersonRHUL/JavaFX-OAuth.git
创建时间: 2017-08-23T01:30:45Z
项目社区:https://github.com/MaxAndersonRHUL/JavaFX-OAuth

开源协议:MIT License

下载


JavaFX-OAuth

Utilising JavaFX WebViews to access Google and Facebook apis with OAuth.

Requires org.json library to parse json files, but this can be changed to your json parser of choice quite easily.

  1. <groupId>org.json</groupId>
  2. <artifactId>json</artifactId>
  3. <version>20160810</version>

This lightweight library makes it conveneint to add OAuth logins and api access to desktop applications built with JavaFX.
Simply create an OAuthAuthenticator object like so:

  1. OAuthAuthenticator authFB = new OAuthFacebookAuthenticator(FACEBOOK_clientID, FACEBOOK_redirectUri, FACEBOOK_clientSecret, FACEBOOK_fieldsString);

And then call:

  1. authFB.startLogin();

to open a new webview for the specified service (In this case, facebook). Users can then login, and the authenticator will retrieve the access token and query the relevant api. Add an OAuthCompletedCallback to get notified when the login has completed, and the returned json data is ready to be read.

Currently supprts facebook and google.