@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; }
@Override protected IndirectClient getClient() { final OkClient okClient = new OkClient(); okClient.setKey("1139019264"); okClient.setPublicKey("CBAPAFOEEBABABABA"); okClient.setSecret("479452FD7CA726DF558B4303"); okClient.setCallbackUrl(PAC4J_URL); return okClient; }