Example #1
0
        private void AuthenticateAdobeSignAccount(ESignAccount account)
        {
            var companyId = PXAccess.GetCompanyName();
            var client    = AdobeSignClientBuilder.BuildUnauthorized(account, companyId);

            PXLongOperation.StartOperation(this, () =>
            {
                var loginUrl = client.Authentication.GetLoginPageUrl();
                throw new PXRedirectToUrlException(loginUrl, PXBaseRedirectException.WindowMode.InlineWindow,
                                                   string.Empty, false);
            });
        }
        private void GetAdobeAccessToken(string code, ESignAccount account)
        {
            var adobeSignClient = AdobeSignClientBuilder.BuildUnauthorized(Accounts.Current);
            var accessToken     = ESignApiExecutor.TryExecute(adobeSignClient.Authentication.CreateAccessToken, code, adobeSignClient);

            account.AccessToken  = accessToken.access_token;
            account.RefreshToken = accessToken.refresh_token;
            account.Status       = Messages.ESignIntegrationStatus.Connected;

            Accounts.Update(account);
            Actions.PressSave();
        }