@@ -52,11 +52,9 @@ public class OAuthSignatureCalculator
52
52
private static final String KEY_OAUTH_TIMESTAMP = "oauth_timestamp" ;
53
53
private static final String KEY_OAUTH_TOKEN = "oauth_token" ;
54
54
private static final String KEY_OAUTH_VERSION = "oauth_version" ;
55
- private static final String KEY_X_AUTH_MODE = "x_auth_mode" ;
56
55
57
56
private static final String OAUTH_VERSION_1_0 = "1.0" ;
58
57
private static final String OAUTH_SIGNATURE_METHOD = "HMAC-SHA1" ;
59
- private static final String OAUTH_REVERSE_AUTH = "reverse_auth" ;
60
58
61
59
/**
62
60
* To generate Nonce, need some (pseudo)randomness; no need for
@@ -72,27 +70,15 @@ public class OAuthSignatureCalculator
72
70
73
71
protected final RequestToken userAuth ;
74
72
75
- protected final Boolean useReverseAuth ;
76
-
77
73
/**
78
74
* @param consumerAuth Consumer key to use for signature calculation
79
75
* @param userAuth Request/access token to use for signature calculation
80
76
*/
81
77
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 ) {
91
78
mac = new ThreadSafeHMAC (consumerAuth , userAuth );
92
79
this .consumerAuth = consumerAuth ;
93
80
this .userAuth = userAuth ;
94
81
random = new Random (System .identityHashCode (this ) + System .currentTimeMillis ());
95
- this .useReverseAuth = useReverseAuth ;
96
82
}
97
83
98
84
//@Override // silly 1.5; doesn't allow this for interfaces
@@ -144,8 +130,6 @@ public String calculateSignature(String method, String baseURL, long oauthTimest
144
130
allParameters .add (KEY_OAUTH_TIMESTAMP , String .valueOf (oauthTimestamp ));
145
131
allParameters .add (KEY_OAUTH_TOKEN , userAuth .getKey ());
146
132
allParameters .add (KEY_OAUTH_VERSION , OAUTH_VERSION_1_0 );
147
- if (useReverseAuth )
148
- allParameters .add (KEY_X_AUTH_MODE , OAUTH_REVERSE_AUTH );
149
133
150
134
if (formParams != null ) {
151
135
for (Map .Entry <String , List <String >> entry : formParams ) {
@@ -196,8 +180,6 @@ public String constructAuthHeader(String signature, String nonce, long oauthTime
196
180
sb .append ("\" , " );
197
181
198
182
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 ("\" " );
201
183
return sb .toString ();
202
184
}
203
185
0 commit comments