function authorizeWithEncryptedNonce(clusterID, encryptedNonce)
% This function is to be used in conjunction with the API getNonce.
% Once a nonce is obtained, authorize performs the handshake with
% Cloud Center and grants the caller permission to call other APIs
% related to the specified cluster.

%   Copyright 2019-2020 The MathWorks, Inc.

cloudCenterClient = parallel.internal.cloud.currentCloudCenterClient();
authorizeFcn = @() cloudCenterClient.authorize(clusterID, encryptedNonce);
responseWithMessages = parallel.internal.mwa.invokeWithLogin(authorizeFcn);
parallel.internal.cloud.checkAndIssueWebServiceWarnings(responseWithMessages);
end
