-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFitbitApi20.java
More file actions
38 lines (30 loc) · 1017 Bytes
/
FitbitApi20.java
File metadata and controls
38 lines (30 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//import com.github.scribejava.apis.service.LinkedIn20ServiceImpl;
import com.github.scribejava.core.builder.api.DefaultApi20;
import com.github.scribejava.core.model.OAuthConfig;
import com.github.scribejava.core.oauth.OAuth20Service;
/**
* Fitbit's OAuth2 client's implementation
* source: https://dev.fitbit.com/docs/oauth2/
*/
public class FitbitApi20 extends DefaultApi20 {
protected FitbitApi20() {
}
private static class InstanceHolder {
private static final FitbitApi20 INSTANCE = new FitbitApi20();
}
public static FitbitApi20 instance() {
return InstanceHolder.INSTANCE;
}
@Override
public String getAccessTokenEndpoint() {
return "https://api.fitbit.com/oauth2/token";
}
@Override
protected String getAuthorizationBaseUrl() {
return "https://www.fitbit.com/oauth2/authorize";
}
@Override
public OAuth20Service createService(OAuthConfig config) {
return new Fitbit20ServiceImpl(this, config);
}
}