@@ -14,7 +14,7 @@ public abstract class OdnoklassnikiExample {
1414
1515 private static final String NETWORK_NAME = "Odnoklassniki.ru" ;
1616 private static final String PROTECTED_RESOURCE_URL
17- = "http ://api.odnoklassniki .ru/api/users/getCurrentUser?application_key=%1$s&format=JSON" ;
17+ = "https ://api.ok .ru/api/users/getCurrentUser?application_key=%1$s&format=JSON" ;
1818
1919 public static void main (String ... args ) {
2020 // Replace these with your client id and secret
@@ -49,12 +49,19 @@ public static void main(String... args) {
4949 // Trade the Request Token and Verfier for the Access Token
5050 System .out .println ("Trading the Request Token for an Access Token..." );
5151
52- final OAuth2AccessToken accessToken = service .getAccessToken (code );
52+ OAuth2AccessToken accessToken = service .getAccessToken (code );
5353 System .out .println ("Got the Access Token!" );
5454 System .out .println ("(if your curious it looks like this: " + accessToken
5555 + ", 'rawResponse'='" + accessToken .getRawResponse () + "')" );
5656 System .out .println ();
5757
58+ System .out .println ("Refreshing the Access Token..." );
59+ accessToken = service .refreshAccessToken (accessToken .getRefreshToken ());
60+ System .out .println ("Refreshed the Access Token!" );
61+ System .out .println ("(if your curious it looks like this: " + accessToken
62+ + ", 'rawResponse'='" + accessToken .getRawResponse () + "')" );
63+ System .out .println ();
64+
5865 // Now let's go and ask for a protected resource!
5966 System .out .println ("Now we're going to access a protected resource..." );
6067 final OAuthRequest request = new OAuthRequest (Verb .GET , String .format (PROTECTED_RESOURCE_URL , publicKey ),
0 commit comments