Skip to content

Latest commit

 

History

History
35 lines (25 loc) · 1.57 KB

README.md

File metadata and controls

35 lines (25 loc) · 1.57 KB

fitbitAPI20-scribe-java

Note: this work now is included in scribe-java's api library

Fitbit's OAuth2.0 basing on scribe-java library

Maven Central

Summary

This is my FitbitAPI20 client's implmentation basing on scribe-java library. To be able to use Fitbit's API 2.0, it's not very difficult, but at many points, they use some details which is not OAuth2.0 standard, thus, you might need to override the default implementation given in scribe-java library.

How to use

It's very to use. Just include two files FitbitApi20.java and Fitbit20ServiceImpl in your projects. Then you can easily setup the Fitbit client like this:

final OAuth20Service service = new ServiceBuilder(clientId)
                .apiSecret(clientSecret)
                .scope("activity profile") // replace with desired scope
                .callback("http://example.com")  //your callback URL to store and handle the authorization code sent by Fitbit
                .build(FitbitApi20.instance());

Of course, you need to include scribe-java as a library. It's very easy if you use Maven:

 <dependency>
          <groupId>com.github.scribejava</groupId>
          <artifactId>scribejava-core</artifactId>
          <version>5.3.0</version>
  </dependency>

Questions

Feel free to drop me an email or create an issue right here. Thanks.