use of edu.uiuc.ncsa.security.delegation.client.request.RTResponse in project OA4MP by ncsa.
the class OA2TestCommands method getrt.
public void getrt(InputLine inputLine) throws Exception {
if (showHelp(inputLine)) {
getRTHelp();
return;
}
RTResponse rtResponse = getOA2S().refresh(dummyAsset.getIdentifier().toString());
dummyAsset = (OA2Asset) getCe().getAssetStore().get(dummyAsset.getIdentifier().toString());
// Have to update the AT reponse here every time or no token state is preserved.
currentATResponse = new ATResponse2(dummyAsset.getAccessToken(), dummyAsset.getRefreshToken());
currentATResponse.setParameters(rtResponse.getParameters());
if (inputLine.hasArg(CLAIMS_FLAG)) {
JSONObject json = JSONObject.fromObject(currentATResponse.getParameters());
if (json.isEmpty()) {
say("(no claims found)");
} else {
say(json.toString(2));
}
}
printTokens();
}
Aggregations