guestService.setApiKeyAttribute(apiKey, "accessToken", accessToken);
guestService.setApiKeyAttribute(apiKey, "tokenExpires", tokenExpires);
guestService.setApiKeyAttribute(apiKey, "refreshTokenRemoveURL", refreshTokenRemoveURL);
guestService.setApiKeyAttribute(apiKey, "refreshToken", refreshToken);
StatusModel result = new StatusModel(true,
"Successfully updated oauth2 tokens: " + connectorName);
return gson.toJson(result);
} else {
StatusModel result = new StatusModel(false,
"Guest does not have that connector: " + connectorName);
return gson.toJson(result);
}
}
catch (Exception e){
return gson.toJson(new StatusModel(false,"Failed to set OAuth2 Tokens: " + e.getMessage()));
}
}