示例#1
0
        private static void DisconnectProcoreClient(AdobeSignClient client)
        {
            var graph     = PXGraph.CreateInstance <ESignAccountEntry>();
            var accountId = client.Authentication.Dependencies.Credentials.AccountId.Value;

            graph.RefreshCurrentSetup(accountId);
            graph.disconnect();
        }
示例#2
0
        private static void ResetRefreshToken(AdobeSignClient client)
        {
            var accessToken = client.Authentication.RefreshAccessToken();

            client.Authentication.Dependencies.Credentials.AccessToken = accessToken.access_token;

            var graph     = PXGraph.CreateInstance <ESignAccountEntry>();
            var accountId = client.Authentication.Dependencies.Credentials.AccountId.Value;

            graph.RefreshCurrentSetup(accountId);

            var setup = graph.Accounts.Current;

            setup.AccessToken = accessToken.access_token;

            graph.Accounts.Update(setup);
            graph.Actions.PressSave();
        }
示例#3
0
 public static T TryExecute <T, TArgs>(Func <TArgs, T> method, TArgs args, AdobeSignClient client)
 {
     try
     {
         return(method(args));
     }
     catch (AdobeSignUnauthorizedException)
     {
         try
         {
             ResetRefreshToken(client);
             return(method(args));
         }
         catch (AdobeSignUnauthorizedException)
         {
             DisconnectProcoreClient(client);
             throw new PXException();
         }
     }
 }