Beispiel #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;
 }
Beispiel #2
0
 public void setSecret(final String secret) {
   configuration.setSecret(secret);
 }
Beispiel #3
0
 public void setKey(final String key) {
   configuration.setKey(key);
 }
Beispiel #4
0
 public String getSecret() {
   return configuration.getSecret();
 }
Beispiel #5
0
 public String getKey() {
   return configuration.getKey();
 }