Skip to content

Commit 6f0d0ab

Browse files
committed
fix Pinterest API (thanks to https://github.com/sschwieb)
1 parent 28cdeda commit 6f0d0ab

3 files changed

Lines changed: 4 additions & 9 deletions

File tree

changelog

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[SNAPSHOT]
22
* fix Salesforce API (thanks to https://github.com/jhorowitz-firedrum)
33
* remove 'final' from methods in OAuth[10a|20]Service to allow mocking it
4+
* fix Pinterest API (thanks to https://github.com/sschwieb)
45

56
[5.2.0-java7again]
67
* allow 'null' as callback. It's an optional parameter. Remove "oob" as default (thanks to https://github.com/massongit)

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

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import com.github.scribejava.core.builder.api.ClientAuthenticationType;
44
import com.github.scribejava.core.builder.api.DefaultApi20;
5-
import com.github.scribejava.core.builder.api.OAuth2SignatureType;
65

76
public class PinterestApi extends DefaultApi20 {
87

@@ -27,11 +26,6 @@ protected String getAuthorizationBaseUrl() {
2726
return "https://api.pinterest.com/oauth";
2827
}
2928

30-
@Override
31-
public OAuth2SignatureType getSignatureType() {
32-
return OAuth2SignatureType.BEARER_URI_QUERY_PARAMETER;
33-
}
34-
3529
@Override
3630
public ClientAuthenticationType getClientAuthenticationType() {
3731
return ClientAuthenticationType.REQUEST_BODY;

scribejava-apis/src/test/java/com/github/scribejava/apis/examples/PinterestExample.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
public final class PinterestExample {
1616

17-
private static final String PROTECTED_RESOURCE_URL = "https://api.pinterest.com/v1/me/?access_token?access_token=";
17+
private static final String PROTECTED_RESOURCE_URL = "https://api.pinterest.com/v1/me/";
1818

1919
private PinterestExample() {
2020
}
@@ -26,7 +26,7 @@ public static void main(String... args) throws IOException, InterruptedException
2626
final OAuth20Service service = new ServiceBuilder(apiKey)
2727
.apiSecret(apiSecret)
2828
.scope("read_public,write_public,read_relationships,write_relationships")
29-
.callback("https://localhost:9000/") // Add as valid callback in developer portal
29+
.callback("https://localhost/") // Add as valid callback in developer portal
3030
.build(PinterestApi.instance());
3131
final Scanner in = new Scanner(System.in);
3232

@@ -53,7 +53,7 @@ public static void main(String... args) throws IOException, InterruptedException
5353

5454
// Now let's go and ask for a protected resource!
5555
System.out.println("Now we're going to access a protected resource...");
56-
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL + accessToken.getAccessToken());
56+
final OAuthRequest request = new OAuthRequest(Verb.GET, PROTECTED_RESOURCE_URL);
5757
service.signRequest(accessToken, request);
5858
final Response response = service.execute(request);
5959
System.out.println("Got it! Lets see what we found...");

0 commit comments

Comments
 (0)