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