Esempio n. 1
0
 @Override
 public String getProfileUrl(
     final OAuth2AccessToken accessToken, final OAuth20Configuration configuration) {
   final OkClient client = (OkClient) configuration.getClient();
   String baseParams =
       "application_key="
           + client.getPublicKey()
           + "&format=json"
           + "&method=users.getCurrentUser";
   String finalSign;
   try {
     String preSign =
         getMD5SignAsHexString(accessToken.getAccessToken() + configuration.getSecret());
     finalSign = getMD5SignAsHexString(baseParams.replaceAll("&", "") + preSign);
   } catch (Exception e) {
     logger.error(e.getMessage());
     return null;
   }
   return API_BASE_URL
       + baseParams
       + "&access_token="
       + accessToken.getAccessToken()
       + "&sig="
       + finalSign;
 }
Esempio n. 2
0
 public void setSecret(final String secret) {
   configuration.setSecret(secret);
 }
Esempio n. 3
0
 public void setKey(final String key) {
   configuration.setKey(key);
 }
Esempio n. 4
0
 public String getSecret() {
   return configuration.getSecret();
 }
Esempio n. 5
0
 public String getKey() {
   return configuration.getKey();
 }