Skip to content

Commit 3b3cbcc

Browse files
committed
update Live API
1 parent 988cc9a commit 3b3cbcc

3 files changed

Lines changed: 4 additions & 10 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
* LinkedIn use Header to sign OAuth2 requests
33
* upgrade ServiceBuilder to check apiKey preconditions compile-tim (not run-time)
4+
* update Live API (thanks to https://github.com/typhoon17)
45

56
[4.1.1]
67
* omit the client_secret parameter if it is an empty string while refreshing token (thanks to https://github.com/KungfuPancake)

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

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

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

76
public class LiveApi extends DefaultApi20 {
87

@@ -17,19 +16,14 @@ public static LiveApi instance() {
1716
return InstanceHolder.INSTANCE;
1817
}
1918

20-
@Override
21-
public Verb getAccessTokenVerb() {
22-
return Verb.GET;
23-
}
24-
2519
@Override
2620
public String getAccessTokenEndpoint() {
2721
return "https://login.live.com/oauth20_token.srf";
2822
}
2923

3024
@Override
3125
protected String getAuthorizationBaseUrl() {
32-
return "https://oauth.live.com/authorize";
26+
return "https://login.live.com/oauth20_authorize.srf";
3327
}
3428

3529
@Override

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,7 @@
1313

1414
public final class LiveExample {
1515

16-
private static final String PROTECTED_RESOURCE_URL
17-
= "https://api.foursquare.com/v2/users/self/friends?oauth_token=";
16+
private static final String PROTECTED_RESOURCE_URL = "https://apis.live.net/v5.0/me";
1817

1918
private LiveExample() {
2019
}
@@ -54,7 +53,7 @@ public static void main(String... args) throws IOException, InterruptedException
5453

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

0 commit comments

Comments
 (0)