Skip to content

Commit 14a4b33

Browse files
committed
separate OAuth1.0a and OAuth2.0 classes
1 parent af55f79 commit 14a4b33

File tree

22 files changed

+311
-56
lines changed

22 files changed

+311
-56
lines changed

changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[SNAPSHOT]
22
* support TLS 1.3 in JDK 11 for Salesforce
33
* fix NPE in Apache HTTP client in case of empty body in HTTP response (e.g. with 204 response code) (thanks to https://github.com/SainagNeelamPatnaik)
4+
* separate OAuth1.0a and OAuth2.0 classes
45

56
[6.3.0]
67
* fix Muplipart request model and implement it for a jdk HTTP client (thanks to https://github.com/NTPape)

scribejava-apis/src/main/java/com/github/scribejava/apis/FacebookApi.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,35 @@ public ClientAuthentication getClientAuthentication() {
7070
return RequestBodyAuthenticationScheme.instance();
7171
}
7272

73+
/**
74+
*
75+
* @param apiKey apiKey
76+
* @param apiSecret apiSecret
77+
* @param callback callback
78+
* @param defaultScope defaultScope
79+
* @param debugStream debugStream
80+
* @param responseType responseType
81+
* @param userAgent userAgent
82+
* @param httpClientConfig httpClientConfig
83+
* @param httpClient httpClient
84+
* @return service
85+
* @deprecated use {@link #createService(java.lang.String, java.lang.String, java.lang.String, java.lang.String,
86+
* java.lang.String, java.lang.String, com.github.scribejava.core.httpclient.HttpClientConfig,
87+
* com.github.scribejava.core.httpclient.HttpClient) }
88+
*/
89+
@Deprecated
7390
@Override
74-
public FacebookService createService(String apiKey, String apiSecret, String callback, String scope,
91+
public FacebookService createService(String apiKey, String apiSecret, String callback, String defaultScope,
7592
OutputStream debugStream, String responseType, String userAgent, HttpClientConfig httpClientConfig,
7693
HttpClient httpClient) {
77-
return new FacebookService(this, apiKey, apiSecret, callback, scope, responseType, userAgent, httpClientConfig,
94+
return createService(apiKey, apiSecret, callback, defaultScope, responseType, userAgent, httpClientConfig,
7895
httpClient);
7996
}
97+
98+
@Override
99+
public FacebookService createService(String apiKey, String apiSecret, String callback, String defaultScope,
100+
String responseType, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) {
101+
return new FacebookService(this, apiKey, apiSecret, callback, defaultScope, responseType, userAgent,
102+
httpClientConfig, httpClient);
103+
}
80104
}

scribejava-apis/src/main/java/com/github/scribejava/apis/ImgurApi.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,35 @@ protected String getAuthorizationBaseUrl() {
5454
throw new UnsupportedOperationException("use getAuthorizationUrl instead");
5555
}
5656

57+
/**
58+
*
59+
* @param apiKey apiKey
60+
* @param apiSecret apiSecret
61+
* @param callback callback
62+
* @param defaultScope defaultScope
63+
* @param debugStream debugStream
64+
* @param responseType responseType
65+
* @param userAgent userAgent
66+
* @param httpClientConfig httpClientConfig
67+
* @param httpClient httpClient
68+
* @return service
69+
* @deprecated use {@link #createService(java.lang.String, java.lang.String, java.lang.String, java.lang.String,
70+
* java.lang.String, java.lang.String, com.github.scribejava.core.httpclient.HttpClientConfig,
71+
* com.github.scribejava.core.httpclient.HttpClient) }
72+
*/
73+
@Deprecated
5774
@Override
58-
public ImgurOAuthService createService(String apiKey, String apiSecret, String callback, String scope,
75+
public ImgurOAuthService createService(String apiKey, String apiSecret, String callback, String defaultScope,
5976
OutputStream debugStream, String responseType, String userAgent, HttpClientConfig httpClientConfig,
6077
HttpClient httpClient) {
61-
return new ImgurOAuthService(this, apiKey, apiSecret, callback, scope, responseType, userAgent,
78+
return createService(apiKey, apiSecret, callback, defaultScope, responseType, userAgent, httpClientConfig,
79+
httpClient);
80+
}
81+
82+
@Override
83+
public ImgurOAuthService createService(String apiKey, String apiSecret, String callback, String defaultScope,
84+
String responseType, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) {
85+
return new ImgurOAuthService(this, apiKey, apiSecret, callback, defaultScope, responseType, userAgent,
6286
httpClientConfig, httpClient);
6387
}
6488

scribejava-apis/src/main/java/com/github/scribejava/apis/MailruApi.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,35 @@ protected String getAuthorizationBaseUrl() {
2929
return "https://connect.mail.ru/oauth/authorize";
3030
}
3131

32+
/**
33+
*
34+
* @param apiKey apiKey
35+
* @param apiSecret apiSecret
36+
* @param callback callback
37+
* @param defaultScope defaultScope
38+
* @param debugStream debugStream
39+
* @param responseType responseType
40+
* @param userAgent userAgent
41+
* @param httpClientConfig httpClientConfig
42+
* @param httpClient httpClient
43+
* @return service
44+
* @deprecated use {@link #createService(java.lang.String, java.lang.String, java.lang.String, java.lang.String,
45+
* java.lang.String, java.lang.String, com.github.scribejava.core.httpclient.HttpClientConfig,
46+
* com.github.scribejava.core.httpclient.HttpClient) }
47+
*/
48+
@Deprecated
3249
@Override
33-
public MailruOAuthService createService(String apiKey, String apiSecret, String callback, String scope,
50+
public MailruOAuthService createService(String apiKey, String apiSecret, String callback, String defaultScope,
3451
OutputStream debugStream, String responseType, String userAgent, HttpClientConfig httpClientConfig,
3552
HttpClient httpClient) {
36-
return new MailruOAuthService(this, apiKey, apiSecret, callback, scope, responseType, userAgent,
53+
return createService(apiKey, apiSecret, callback, defaultScope, responseType, userAgent, httpClientConfig,
54+
httpClient);
55+
}
56+
57+
@Override
58+
public MailruOAuthService createService(String apiKey, String apiSecret, String callback, String defaultScope,
59+
String responseType, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) {
60+
return new MailruOAuthService(this, apiKey, apiSecret, callback, defaultScope, responseType, userAgent,
3761
httpClientConfig, httpClient);
3862
}
3963
}

scribejava-apis/src/main/java/com/github/scribejava/apis/OdnoklassnikiApi.java

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,36 @@ protected String getAuthorizationBaseUrl() {
3333
return "https://connect.ok.ru/oauth/authorize";
3434
}
3535

36+
/**
37+
*
38+
* @param apiKey apiKey
39+
* @param apiSecret apiSecret
40+
* @param callback callback
41+
* @param defaultScope defaultScope
42+
* @param debugStream debugStream
43+
* @param responseType responseType
44+
* @param userAgent userAgent
45+
* @param httpClientConfig httpClientConfig
46+
* @param httpClient httpClient
47+
* @return service
48+
* @deprecated use {@link #createService(java.lang.String, java.lang.String, java.lang.String, java.lang.String,
49+
* java.lang.String, java.lang.String, com.github.scribejava.core.httpclient.HttpClientConfig,
50+
* com.github.scribejava.core.httpclient.HttpClient) }
51+
*/
52+
@Deprecated
3653
@Override
37-
public OdnoklassnikiOAuthService createService(String apiKey, String apiSecret, String callback, String scope,
38-
OutputStream debugStream, String responseType, String userAgent, HttpClientConfig httpClientConfig,
54+
public OdnoklassnikiOAuthService createService(String apiKey, String apiSecret, String callback,
55+
String defaultScope, OutputStream debugStream, String responseType, String userAgent,
56+
HttpClientConfig httpClientConfig, HttpClient httpClient) {
57+
return createService(apiKey, apiSecret, callback, defaultScope, responseType, userAgent, httpClientConfig,
58+
httpClient);
59+
}
60+
61+
@Override
62+
public OdnoklassnikiOAuthService createService(String apiKey, String apiSecret, String callback,
63+
String defaultScope, String responseType, String userAgent, HttpClientConfig httpClientConfig,
3964
HttpClient httpClient) {
40-
return new OdnoklassnikiOAuthService(this, apiKey, apiSecret, callback, scope, responseType, userAgent,
65+
return new OdnoklassnikiOAuthService(this, apiKey, apiSecret, callback, defaultScope, responseType, userAgent,
4166
httpClientConfig, httpClient);
4267
}
4368

scribejava-apis/src/main/java/com/github/scribejava/apis/WunderlistAPI.java

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,35 @@ public ClientAuthentication getClientAuthentication() {
4848
return RequestBodyAuthenticationScheme.instance();
4949
}
5050

51+
/**
52+
*
53+
* @param apiKey apiKey
54+
* @param apiSecret apiSecret
55+
* @param callback callback
56+
* @param defaultScope defaultScope
57+
* @param debugStream debugStream
58+
* @param responseType responseType
59+
* @param userAgent userAgent
60+
* @param httpClientConfig httpClientConfig
61+
* @param httpClient httpClient
62+
* @return service
63+
* @deprecated use {@link #createService(java.lang.String, java.lang.String, java.lang.String, java.lang.String,
64+
* java.lang.String, java.lang.String, com.github.scribejava.core.httpclient.HttpClientConfig,
65+
* com.github.scribejava.core.httpclient.HttpClient) }
66+
*/
67+
@Deprecated
5168
@Override
52-
public OAuth20Service createService(String apiKey, String apiSecret, String callback, String scope,
69+
public OAuth20Service createService(String apiKey, String apiSecret, String callback, String defaultScope,
5370
OutputStream debugStream, String responseType, String userAgent, HttpClientConfig httpClientConfig,
5471
HttpClient httpClient) {
55-
return new WunderlistOAuthService(this, apiKey, apiSecret, callback, scope, responseType, userAgent,
72+
return createService(apiKey, apiSecret, callback, defaultScope, responseType, userAgent, httpClientConfig,
73+
httpClient);
74+
}
75+
76+
@Override
77+
public OAuth20Service createService(String apiKey, String apiSecret, String callback, String defaultScope,
78+
String responseType, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) {
79+
return new WunderlistOAuthService(this, apiKey, apiSecret, callback, defaultScope, responseType, userAgent,
5680
httpClientConfig, httpClient);
5781
}
5882
}

scribejava-apis/src/main/java/com/github/scribejava/apis/facebook/FacebookService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
public class FacebookService extends OAuth20Service {
1515

16-
public FacebookService(DefaultApi20 api, String apiKey, String apiSecret, String callback, String scope,
16+
public FacebookService(DefaultApi20 api, String apiKey, String apiSecret, String callback, String defaultScope,
1717
String responseType, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) {
18-
super(api, apiKey, apiSecret, callback, scope, responseType, userAgent, httpClientConfig, httpClient);
18+
super(api, apiKey, apiSecret, callback, defaultScope, responseType, userAgent, httpClientConfig, httpClient);
1919
}
2020

2121
@Override

scribejava-apis/src/main/java/com/github/scribejava/apis/imgur/ImgurOAuthService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010

1111
public class ImgurOAuthService extends OAuth20Service {
1212

13-
public ImgurOAuthService(DefaultApi20 api, String apiKey, String apiSecret, String callback, String scope,
13+
public ImgurOAuthService(DefaultApi20 api, String apiKey, String apiSecret, String callback, String defaultScope,
1414
String responseType, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) {
15-
super(api, apiKey, apiSecret, callback, scope, responseType, userAgent, httpClientConfig, httpClient);
15+
super(api, apiKey, apiSecret, callback, defaultScope, responseType, userAgent, httpClientConfig, httpClient);
1616
}
1717

1818
@Override

scribejava-apis/src/main/java/com/github/scribejava/apis/mailru/MailruOAuthService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
public class MailruOAuthService extends OAuth20Service {
1818

19-
public MailruOAuthService(DefaultApi20 api, String apiKey, String apiSecret, String callback, String scope,
19+
public MailruOAuthService(DefaultApi20 api, String apiKey, String apiSecret, String callback, String defaultScope,
2020
String responseType, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) {
21-
super(api, apiKey, apiSecret, callback, scope, responseType, userAgent, httpClientConfig, httpClient);
21+
super(api, apiKey, apiSecret, callback, defaultScope, responseType, userAgent, httpClientConfig, httpClient);
2222
}
2323

2424
@Override

scribejava-apis/src/main/java/com/github/scribejava/apis/odnoklassniki/OdnoklassnikiOAuthService.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,10 @@
1919

2020
public class OdnoklassnikiOAuthService extends OAuth20Service {
2121

22-
public OdnoklassnikiOAuthService(DefaultApi20 api, String apiKey, String apiSecret, String callback, String scope,
23-
String responseType, String userAgent, HttpClientConfig httpClientConfig, HttpClient httpClient) {
24-
super(api, apiKey, apiSecret, callback, scope, responseType, userAgent, httpClientConfig, httpClient);
22+
public OdnoklassnikiOAuthService(DefaultApi20 api, String apiKey, String apiSecret, String callback,
23+
String defaultScope, String responseType, String userAgent, HttpClientConfig httpClientConfig,
24+
HttpClient httpClient) {
25+
super(api, apiKey, apiSecret, callback, defaultScope, responseType, userAgent, httpClientConfig, httpClient);
2526
}
2627

2728
@Override

0 commit comments

Comments
 (0)