Skip to content

Commit 1c8442a

Browse files
committed
Revert change for reverse auth
1 parent 05159b5 commit 1c8442a

File tree

1 file changed

+0
-18
lines changed

1 file changed

+0
-18
lines changed

api/src/main/java/com/ning/http/client/oauth/OAuthSignatureCalculator.java

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,9 @@ public class OAuthSignatureCalculator
5252
private static final String KEY_OAUTH_TIMESTAMP = "oauth_timestamp";
5353
private static final String KEY_OAUTH_TOKEN = "oauth_token";
5454
private static final String KEY_OAUTH_VERSION = "oauth_version";
55-
private static final String KEY_X_AUTH_MODE = "x_auth_mode";
5655

5756
private static final String OAUTH_VERSION_1_0 = "1.0";
5857
private static final String OAUTH_SIGNATURE_METHOD = "HMAC-SHA1";
59-
private static final String OAUTH_REVERSE_AUTH = "reverse_auth";
6058

6159
/**
6260
* To generate Nonce, need some (pseudo)randomness; no need for
@@ -72,27 +70,15 @@ public class OAuthSignatureCalculator
7270

7371
protected final RequestToken userAuth;
7472

75-
protected final Boolean useReverseAuth;
76-
7773
/**
7874
* @param consumerAuth Consumer key to use for signature calculation
7975
* @param userAuth Request/access token to use for signature calculation
8076
*/
8177
public OAuthSignatureCalculator(ConsumerKey consumerAuth, RequestToken userAuth) {
82-
this(consumerAuth, userAuth, false);
83-
}
84-
85-
/**
86-
* @param consumerAuth Consumer key to use for signature calculation
87-
* @param userAuth Request/access token to use for signature calculation
88-
* @param useReverseAuth Whether or not to use the reverse auth signature or the regular one
89-
*/
90-
public OAuthSignatureCalculator(ConsumerKey consumerAuth, RequestToken userAuth, Boolean useReverseAuth ) {
9178
mac = new ThreadSafeHMAC(consumerAuth, userAuth);
9279
this.consumerAuth = consumerAuth;
9380
this.userAuth = userAuth;
9481
random = new Random(System.identityHashCode(this) + System.currentTimeMillis());
95-
this.useReverseAuth = useReverseAuth;
9682
}
9783

9884
//@Override // silly 1.5; doesn't allow this for interfaces
@@ -144,8 +130,6 @@ public String calculateSignature(String method, String baseURL, long oauthTimest
144130
allParameters.add(KEY_OAUTH_TIMESTAMP, String.valueOf(oauthTimestamp));
145131
allParameters.add(KEY_OAUTH_TOKEN, userAuth.getKey());
146132
allParameters.add(KEY_OAUTH_VERSION, OAUTH_VERSION_1_0);
147-
if (useReverseAuth)
148-
allParameters.add(KEY_X_AUTH_MODE, OAUTH_REVERSE_AUTH);
149133

150134
if (formParams != null) {
151135
for (Map.Entry<String, List<String>> entry : formParams) {
@@ -196,8 +180,6 @@ public String constructAuthHeader(String signature, String nonce, long oauthTime
196180
sb.append("\", ");
197181

198182
sb.append(KEY_OAUTH_VERSION).append("=\"").append(OAUTH_VERSION_1_0).append("\"");
199-
if (useReverseAuth)
200-
sb.append(KEY_X_AUTH_MODE).append("=\"").append(OAUTH_REVERSE_AUTH).append("\"");
201183
return sb.toString();
202184
}
203185

0 commit comments

Comments
 (0)