Skip to content

Commit 0f39939

Browse files
committed
conforms OAuth 1.0 Tokens to the last not obsolete specs
1 parent 72d4ecf commit 0f39939

File tree

3 files changed

+47
-17
lines changed

3 files changed

+47
-17
lines changed

scribejava-core/src/main/java/com/github/scribejava/core/model/OAuth1AccessToken.java

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
import java.util.Objects;
44

55
/**
6-
* Represents an OAuth 1 Access Token http://oauth.net/core/1.0a/#rfc.section.6.3.2
6+
* Represents an OAuth 1 Access Token http://tools.ietf.org/html/rfc5849#section-2.3
77
*/
88
public class OAuth1AccessToken extends OAuth1Token {
99

10-
private static final long serialVersionUID = -8784937061938486135L;
10+
private static final long serialVersionUID = -103999293167210966L;
1111

1212
public OAuth1AccessToken(String token, String tokenSecret) {
1313
this(token, tokenSecret, null);
@@ -17,6 +17,26 @@ public OAuth1AccessToken(String token, String tokenSecret, String rawResponse) {
1717
super(token, tokenSecret, rawResponse);
1818
}
1919

20+
/**
21+
* The token identifier.
22+
*
23+
* @return oauth_token
24+
*/
25+
@Override
26+
public String getToken() {
27+
return super.getToken();
28+
}
29+
30+
/**
31+
* The token shared-secret.
32+
*
33+
* @return oauth_token_secret
34+
*/
35+
@Override
36+
public String getTokenSecret() {
37+
return super.getTokenSecret();
38+
}
39+
2040
@Override
2141
public int hashCode() {
2242
int hash = 3;

scribejava-core/src/main/java/com/github/scribejava/core/model/OAuth1RequestToken.java

Lines changed: 25 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
import java.util.Objects;
44

55
/**
6-
* Represents an OAuth 1 Request Token http://oauth.net/core/1.0a/#rfc.section.6.1.2
6+
* Represents an OAuth 1 Request Token http://tools.ietf.org/html/rfc5849#section-2.1
77
*/
88
public class OAuth1RequestToken extends OAuth1Token {
99

10-
private static final long serialVersionUID = 359527630020350893L;
10+
private static final long serialVersionUID = 6185104114662587991L;
1111

1212
/**
1313
* oauth_callback_confirmed:
1414
* <p>
15-
* MUST be present and set to true. The Consumer MAY use this to confirm that the Service Provider received the
16-
* callback value.</p>
15+
* MUST be present and set to "true". The parameter is used to differentiate from previous versions of the protocol.
16+
* </p>
1717
*/
1818
private final boolean oauthCallbackConfirmed;
1919

@@ -30,6 +30,26 @@ public OAuth1RequestToken(String token, String tokenSecret, boolean oauthCallbac
3030
this.oauthCallbackConfirmed = oauthCallbackConfirmed;
3131
}
3232

33+
/**
34+
* The temporary credentials identifier.
35+
*
36+
* @return oauth_token
37+
*/
38+
@Override
39+
public String getToken() {
40+
return super.getToken();
41+
}
42+
43+
/**
44+
* The temporary credentials shared-secret.
45+
*
46+
* @return oauth_token_secret
47+
*/
48+
@Override
49+
public String getTokenSecret() {
50+
return super.getTokenSecret();
51+
}
52+
3353
public boolean isOauthCallbackConfirmed() {
3454
return oauthCallbackConfirmed;
3555
}
@@ -69,6 +89,6 @@ public String toString() {
6989
return "OAuth1RequestToken{"
7090
+ "oauth_token=" + getToken()
7191
+ ", oauth_token_secret=" + getTokenSecret()
72-
+ ", oauthCallbackConfirmed=" + oauthCallbackConfirmed + '}';
92+
+ ", oauth_callback_confirmed=" + oauthCallbackConfirmed + '}';
7393
}
7494
}

scribejava-core/src/main/java/com/github/scribejava/core/model/OAuth1Token.java

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,8 @@ public abstract class OAuth1Token extends Token {
99

1010
private static final long serialVersionUID = 6285873427974823019L;
1111

12-
/**
13-
* oauth_token:
14-
* <p>
15-
* The Request/Access Token.</p>
16-
*/
1712
private final String token;
1813

19-
/**
20-
* oauth_token_secret:
21-
* <p>
22-
* The Token Secret.</p>
23-
*/
2414
private final String tokenSecret;
2515

2616
public OAuth1Token(String token, String tokenSecret, String rawResponse) {

0 commit comments

Comments
 (0)