Skip to content

Commit 0e5ae92

Browse files
Added exceptions to both token methods on 2.0 service
Rebased 1.0.9
1 parent c145ee8 commit 0e5ae92

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/main/java/org/scribe/builder/api/GoogleApi.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ public String getRequestTokenEndpoint()
1919
}
2020

2121
@Override
22-
protected Verb getAccessTokenVerb()
22+
public Verb getAccessTokenVerb()
2323
{
2424
return Verb.GET;
2525
}
2626

2727
@Override
28-
protected Verb getRequestTokenVerb()
28+
public Verb getRequestTokenVerb()
2929
{
3030
return Verb.GET;
3131
}

src/main/java/org/scribe/builder/api/LinkedInApi.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
package org.scribe.builder.api;
22

3+
import org.scribe.model.*;
4+
35
public class LinkedInApi extends DefaultApi10a
46
{
57
private static final String AUTHORIZE_URL = "https://api.linkedin.com/uas/oauth/authorize?oauth_token=%s";
68

79
@Override
8-
protected String getAccessTokenEndpoint()
10+
public String getAccessTokenEndpoint()
911
{
1012
return "https://api.linkedin.com/uas/oauth/accessToken";
1113
}
1214

1315
@Override
14-
protected String getRequestTokenEndpoint()
16+
public String getRequestTokenEndpoint()
1517
{
1618
return "https://api.linkedin.com/uas/oauth/requestToken";
1719
}

src/main/java/org/scribe/oauth/OAuth2ServiceImpl.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ public void addScope(String scope)
2323
@Override
2424
public Token getAccessToken(Token requestToken, Verifier verifier)
2525
{
26-
return null;
26+
throw new UnsupportedOperationException("Unsupported operation, please use 'getAuthorizationUrl' and redirect your users there");
2727
}
2828

2929
@Override
3030
public Token getRequestToken()
3131
{
32-
throw new UnsupportedOperationException("OAuth 2 does not use request tokens. Use 'getAccessToken' directly");
32+
throw new UnsupportedOperationException("Unsupported operation, please use 'getAuthorizationUrl' and redirect your users there");
3333
}
3434

3535
@Override

0 commit comments

Comments
 (0)