コード例 #1
0
        public async Task <ActionResult> Create(string Name, string Number)
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            var asset = new Asset()
            {
                AssetName   = Name,
                AssetNumber = Number
            };

            var AssetApi = new AssetApi();
            var response = await AssetApi.CreateAssetAsync(accessToken, xeroTenantId, asset);

            return(RedirectToAction("Index", "AssetsInfo"));
        }
コード例 #2
0
        public async Task <CommandResult> Handle(DisconnectCommand request, CancellationToken cancellationToken)
        {
            var client = new XeroClient(_xeroConfig.Value, _httpClientFactory.CreateClient("xero"));

            var xeroToken = await _tokenRepository.Get();

            if (xeroToken is null)
            {
                return(CommandResult.Fail("No Connection Found"));
            }

            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                await _tokenRepository.Create(xeroToken);
            }

            var xeroTenant = xeroToken.Tenants[0];
            await client.DeleteConnectionAsync(xeroToken, xeroTenant);

            await _tokenRepository.Delete();

            return(CommandResult.Success);
        }
コード例 #3
0
        // GET: ContactsInfo
        public async Task <ActionResult> Index()
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            var serviceProvider   = new ServiceCollection().AddHttpClient().BuildServiceProvider();
            var httpClientFactory = serviceProvider.GetService <IHttpClientFactory>();

            XeroConfiguration XeroConfig = new XeroConfiguration
            {
                ClientId     = ConfigurationManager.AppSettings["XeroClientId"],
                ClientSecret = ConfigurationManager.AppSettings["XeroClientSecret"],
                CallbackUri  = new Uri(ConfigurationManager.AppSettings["XeroCallbackUri"]),
                Scope        = ConfigurationManager.AppSettings["XeroScope"],
                State        = ConfigurationManager.AppSettings["XeroState"]
            };

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig, httpClientFactory);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            var AccountingApi = new AccountingApi();
            var response      = await AccountingApi.GetContactsAsync(accessToken, xeroTenantId);

            var contacts = response._Contacts;

            return(View(contacts));
        }
        // GET: /Organisation/
        public async Task <ActionResult> Index()
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value, httpClientFactory);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            var AccountingApi = new AccountingApi();
            var response      = await AccountingApi.GetOrganisationsAsync(accessToken, xeroTenantId);

            var organisation_info = new Organisation();

            organisation_info = response._Organisations[0];

            return(View(organisation_info));
        }
コード例 #5
0
 public HttpClient(string baseUri, ITokenStore tokenStore)
 {
     _baseUri    = baseUri;
     _headers    = new Dictionary <string, string>();
     _xeroClient = new XeroClient();
     _tokenStore = tokenStore;
 }
コード例 #6
0
        public async Task <IActionResult> CallBack(string code, string session_state)
        {
            XeroConfiguration xconfig = new XeroConfiguration();

            xconfig.ClientId     = "713B16BE2997493E8F3F37AD00400F25";
            xconfig.ClientSecret = "GCu6vvrQ6HFgzWKsOAysK2Q78rtQW_jB_V97sKbGvulKuhib";
            xconfig.CallbackUri  = new Uri("http://localhost:5000/signin-oidc"); //default for standard webapi template
            xconfig.Scope        = "openid profile email files accounting.transactions accounting.contacts offline_access accounting.contacts.read";

            var client = new XeroClient(xconfig, _httpClientFactory);

            //before getting the access token please check that the state matches
            var token = await client.RequestAccessTokenAsync(code);

            XeroEmployeeService.Token  = token;
            XeroEmployeeService.Client = client;
            // //from here you will need to access your Xero Tenants
            // List<Tenant> tenants = await client.GetConnectionsAsync(token);
            //
            // // you will now have the tenant id and access token
            // foreach (Tenant tenant in tenants)
            // {
            //     // do something with your tenant and access token
            //     //client.AccessToken;
            //     //tenant.TenantId;
            // }

            return(Redirect("index.html"));
        }
コード例 #7
0
        public async Task <ActionResult> Create(string Name, string EmailAddress)
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value, httpClientFactory);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            var contact = new Contact();

            contact.Name         = Name;
            contact.EmailAddress = EmailAddress;
            var contacts = new Contacts();

            contacts._Contacts = new List <Contact>()
            {
                contact
            };

            var AccountingApi = new AccountingApi();
            var response      = await AccountingApi.CreateContactsAsync(accessToken, xeroTenantId, contacts);

            return(RedirectToAction("Index", "ContactsInfo"));
        }
        // GET: /Authorization/Callback
        public async Task <ActionResult> Callback(string code, string state)
        {
            var serviceProvider   = new ServiceCollection().AddHttpClient().BuildServiceProvider();
            var httpClientFactory = serviceProvider.GetService <IHttpClientFactory>();

            XeroConfiguration XeroConfig = new XeroConfiguration
            {
                ClientId     = ConfigurationManager.AppSettings["XeroClientId"],
                ClientSecret = ConfigurationManager.AppSettings["XeroClientSecret"],
                CallbackUri  = new Uri(ConfigurationManager.AppSettings["XeroCallbackUri"]),
                Scope        = ConfigurationManager.AppSettings["XeroScope"],
                State        = ConfigurationManager.AppSettings["XeroState"]
            };

            var client = new XeroClient(XeroConfig, httpClientFactory);

            var xeroToken = (XeroOAuth2Token)await client.RequestXeroTokenAsync(code);

            List <Tenant> tenants = await client.GetConnectionsAsync(xeroToken);

            Tenant firstTenant = tenants[0];

            TokenUtilities.StoreToken(xeroToken);

            return(RedirectToAction("Index", "OrganisationInfo"));
        }
コード例 #9
0
        // GET: /InvoiceSync/
        public async Task <ActionResult> Index()
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value, httpClientFactory);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            var AccountingApi = new AccountingApi();


            var sevenDaysAgo   = DateTime.Now.AddDays(-7).ToString("yyyy, MM, dd");
            var invoicesFilter = "Date >= DateTime(" + sevenDaysAgo + ")";

            var response = await AccountingApi.GetInvoicesAsync(accessToken, xeroTenantId, null, invoicesFilter);

            var invoices = response._Invoices;

            return(View(invoices));
        }
コード例 #10
0
        public async Task <ActionResult> Create(string Name, string LineDescription, string LineQuantity, string LineUnitAmount, string LineAccountCode)
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value, httpClientFactory);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            var contact = new Contact();

            contact.Name = Name;

            var line = new LineItem()
            {
                Description = LineDescription,
                Quantity    = decimal.Parse(LineQuantity),
                UnitAmount  = decimal.Parse(LineUnitAmount),
                AccountCode = LineAccountCode
            };

            var lines = new List <LineItem>()
            {
                line
            };

            var invoice = new Invoice()
            {
                Type      = Invoice.TypeEnum.ACCREC,
                Contact   = contact,
                Date      = DateTime.Today,
                DueDate   = DateTime.Today.AddDays(30),
                LineItems = lines
            };

            var invoiceList = new List <Invoice>();

            invoiceList.Add(invoice);

            var invoices = new Invoices();

            invoices._Invoices = invoiceList;

            var AccountingApi = new AccountingApi();
            var response      = await AccountingApi.CreateInvoicesAsync(accessToken, xeroTenantId, invoices);

            var updatedUTC = response._Invoices[0].UpdatedDateUTC;

            return(RedirectToAction("Index", "InvoiceSync"));
        }
        public async Task <ActionResult> Create(string firstName, string lastName, string DateOfBirth)
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value, httpClientFactory);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            // var contact = new Contact();
            // contact.Name = Name;
            // contact.EmailAddress = EmailAddress;
            // var contacts = new Contacts();
            // contacts._Contacts = new List<Contact>() { contact };

            DateTime dob = DateTime.Today.AddYears(-20);

            HomeAddress homeAddress = new HomeAddress()
            {
                AddressLine1 = "6 MeatMe Street",
                AddressLine2 = " ",
                Region       = State.VIC,
                City         = "Long Island",
                PostalCode   = "9999",
                Country      = "New York"
            };

            Employee employee = new Employee()
            {
                FirstName   = firstName,
                LastName    = lastName,
                DateOfBirth = dob,
                HomeAddress = homeAddress
            };

            var employees = new List <Employee>()
            {
                employee
            };

            var PayrollAUApi = new PayrollAuApi();
            var response     = await PayrollAUApi.CreateEmployeeAsync(accessToken, xeroTenantId, employees);

            return(RedirectToAction("Index", "EmployeesInfo"));
        }
コード例 #12
0
        public IActionResult Index()
        {
            var xconfig = new XeroConfiguration();

            xconfig.ClientId     = "713B16BE2997493E8F3F37AD00400F25";
            xconfig.ClientSecret = "GCu6vvrQ6HFgzWKsOAysK2Q78rtQW_jB_V97sKbGvulKuhib";
            xconfig.CallbackUri  = new Uri("http://localhost:5000/signin-oidc"); //default for standard webapi template
            xconfig.Scope        = "openid profile email offline_access files accounting.transactions accounting.contacts";

            var client = new XeroClient(xconfig, _httpClientFactory);

            return(Redirect(client.BuildLoginUri()));
        }
コード例 #13
0
        // GET /Authorization/Callback
        public async Task <ActionResult> Callback(string code, string state)
        {
            var client    = new XeroClient(XeroConfig.Value, httpClientFactory);
            var xeroToken = (XeroOAuth2Token)await client.RequestXeroTokenAsync(code);

            List <Tenant> tenants = await client.GetConnectionsAsync(xeroToken);

            Tenant firstTenant = tenants[0];

            TokenUtilities.StoreToken(xeroToken);

            return(RedirectToAction("Index", "OrganisationInfo"));
        }
コード例 #14
0
        public async Task <IXeroToken> GetTokensAsync(string code, string state)
        {
            var client = new XeroClient(_xeroConfig, _httpClientFactory);

            //before getting the access token please check that the state matches
            _xeroToken = await client.RequestXeroTokenAsync(code);

            //from here you will need to access your Xero Tenants
            List <Tenant> tenants = await client.GetConnectionsAsync(_xeroToken);

            _xeroToken.Tenants = tenants;
            return(_xeroToken);
        }
コード例 #15
0
        // GET /Authorization/Callback
        public async Task <ActionResult> Callback(string code, string state)
        {
            var client    = new XeroClient(XeroConfig.Value);
            var xeroToken = (XeroOAuth2Token)await client.RequestAccessTokenAsync(code);

            List <Tenant> tenants = await client.GetConnectionsAsync(xeroToken);

            Tenant firstTenant = tenants[0];

            TokenUtilities.StoreToken(xeroToken);

            return(Redirect("http://localhost:3000/home"));
        }
コード例 #16
0
        public async Task <CommandResult> Handle(CreateAccessTokenCommand request, CancellationToken cancellationToken)
        {
            //If Xero Auth flow was cancelled by used
            if (string.IsNullOrWhiteSpace(request.Code))
            {
                return(CommandResult.Success);
            }

            var client    = new XeroClient(_xeroConfig.Value, _httpClientFactory.CreateClient("xero"));
            var xeroToken = (XeroOAuth2Token)await client.RequestAccessTokenAsync(request.Code);

            await _tokenRepository.Create(xeroToken);

            return(CommandResult.Success);
        }
コード例 #17
0
        public async Task <ActionResult> Create(string Name, string EmailAddress)
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            var serviceProvider   = new ServiceCollection().AddHttpClient().BuildServiceProvider();
            var httpClientFactory = serviceProvider.GetService <IHttpClientFactory>();

            XeroConfiguration XeroConfig = new XeroConfiguration
            {
                ClientId     = ConfigurationManager.AppSettings["XeroClientId"],
                ClientSecret = ConfigurationManager.AppSettings["XeroClientSecret"],
                CallbackUri  = new Uri(ConfigurationManager.AppSettings["XeroCallbackUri"]),
                Scope        = ConfigurationManager.AppSettings["XeroScope"],
                State        = ConfigurationManager.AppSettings["XeroState"]
            };

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig, httpClientFactory);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            var contact = new Contact
            {
                Name         = Name,
                EmailAddress = EmailAddress
            };

            var contacts = new Contacts();

            contacts._Contacts = new List <Contact>()
            {
                contact
            };

            var AccountingApi = new AccountingApi();
            var response      = await AccountingApi.CreateContactsAsync(accessToken, xeroTenantId, contacts);

            return(RedirectToAction("Index", "ContactsInfo"));
        }
        // GET: /Authorization
        public ActionResult Index()
        {
            var serviceProvider   = new ServiceCollection().AddHttpClient().BuildServiceProvider();
            var httpClientFactory = serviceProvider.GetService <IHttpClientFactory>();

            XeroConfiguration XeroConfig = new XeroConfiguration
            {
                ClientId     = ConfigurationManager.AppSettings["XeroClientId"],
                ClientSecret = ConfigurationManager.AppSettings["XeroClientSecret"],
                CallbackUri  = new Uri(ConfigurationManager.AppSettings["XeroCallbackUri"]),
                Scope        = ConfigurationManager.AppSettings["XeroScope"],
                State        = ConfigurationManager.AppSettings["XeroState"]
            };

            var client = new XeroClient(XeroConfig, httpClientFactory);

            return(Redirect(client.BuildLoginUri()));
        }
コード例 #19
0
        public XeroPrivateApplication(string key, string secret, string pfxFile, string pfxPassword)
        {
            EndpointAddress endpointAddress = new EndpointAddress("https://api.xero.com/api.xro/2.0/");

            IPHostEntry hostEntry = Dns.GetHostEntry(endpointAddress.Uri.DnsSafeHost);

            if (hostEntry.AddressList.Length == 0)
                throw new NotSupportedException("Unable to resolve host");

            OAuthClientCredentials credentials = new OAuthClientCredentials();
            credentials.OAuthKey = key;
            credentials.OAuthToken = key;
            credentials.OAuthSecret = secret;
            credentials.OAuthTokenSecret = secret;
            credentials.OAuthPfxFile = pfxFile;
            credentials.OAuthPfxPassword = pfxPassword;
            credentials.OAuthRealm = hostEntry.AddressList[0].ToString();

            _client = new XeroClient(endpointAddress, credentials);
        }
        // GET: /IdentityInfo/
        public async Task <ActionResult> Index()
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value, httpClientFactory);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken = xeroToken.AccessToken;

            var IdentityApi = new IdentityApi();
            var response    = await IdentityApi.GetConnectionsAsync(accessToken);

            var connections = response;

            return(View(connections));
        }
コード例 #21
0
        // GET /Authorization/Disconnect
        public async Task <ActionResult> Disconnect()
        {
            var client = new XeroClient(XeroConfig.Value, httpClientFactory);

            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken = xeroToken.AccessToken;
            Tenant xeroTenant  = xeroToken.Tenants[0];

            await client.DeleteConnectionAsync(xeroToken, xeroTenant);

            TokenUtilities.DestroyToken();

            return(RedirectToAction("Index", "Home"));
        }
        // GET: /EmployeesInfo/
        public async Task <ActionResult> Index()
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value, httpClientFactory);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            var PayrollAUApi = new PayrollAuApi();
            var response     = await PayrollAUApi.GetEmployeesAsync(accessToken, xeroTenantId);

            var employees = response._Employees;

            return(View(employees));
        }
        public async Task <ActionResult> Delete(string connectionId)
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value, httpClientFactory);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken      = xeroToken.AccessToken;
            Guid   connectionIdGuid = Guid.Parse(connectionId);

            var IdentityApi = new IdentityApi();
            await IdentityApi.DeleteConnectionAsync(accessToken, connectionIdGuid);

            TokenUtilities.DestroyToken();

            return(RedirectToAction("Index", "Home"));
        }
コード例 #24
0
        // GET: /InvoicePdf/
        public async Task <ActionResult> Index()
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            Guid invoiceId = Guid.Parse("d5654fc7-be8e-42e5-802a-9f5ab9d2476a");

            var AccountingApi = new AccountingApi();

            var response = await AccountingApi.GetInvoiceAsPdfAsync(accessToken, xeroTenantId, invoiceId);

            return(new FileStreamResult(response, "application/pdf"));
        }
コード例 #25
0
        // GET: /Assets/
        public async Task <ActionResult> Index()
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            var AssetApi = new AssetApi();

            var response = await AssetApi.GetAssetsAsync(accessToken, xeroTenantId, AssetStatusQueryParam.DRAFT);

            var assetItems = response.Items;

            return(View(assetItems));
        }
コード例 #26
0
        // GET: /InvoiceSync/
        public async Task <ActionResult> Index()
        {
            var xeroToken  = TokenUtilities.GetStoredToken();
            var utcTimeNow = DateTime.UtcNow;

            if (utcTimeNow > xeroToken.ExpiresAtUtc)
            {
                var client = new XeroClient(XeroConfig.Value);
                xeroToken = (XeroOAuth2Token)await client.RefreshAccessTokenAsync(xeroToken);

                TokenUtilities.StoreToken(xeroToken);
            }

            string accessToken  = xeroToken.AccessToken;
            string xeroTenantId = xeroToken.Tenants[0].TenantId.ToString();

            var AccountingApi = new AccountingApi();

            var response = await AccountingApi.GetInvoicesAsync(accessToken, xeroTenantId);

            var invoices = response._Invoices;

            return(Json(invoices));
        }
コード例 #27
0
        public async Task <GetLoginUriQueryResult> Handle(GetLoginUriQuery request, CancellationToken cancellationToken)
        {
            var client = new XeroClient(_xeroConfig.Value, _httpClientFactory.CreateClient());

            return(await Task.Run(() => new GetLoginUriQueryResult(client.BuildLoginUri()), cancellationToken));
        }
コード例 #28
0
        public string GetLoginUrl()
        {
            var client = new XeroClient(_xeroConfig, _httpClientFactory);

            return(client.BuildLoginUri());
        }
コード例 #29
0
        public IActionResult Index()
        {
            var client = new XeroClient(XeroConfig.Value, httpClientFactory);

            return(Redirect(client.BuildLoginUri()));
        }
コード例 #30
0
 public AuthorizationServices(XeroClient client, ITokenStore tokenStore)
 {
     _client     = client;
     _tokenStore = tokenStore;
 }
コード例 #31
0
 public TenantAccess(XeroClient client, ITokenStore tokenStorage)
 {
     Client       = client;
     TokenStorage = tokenStorage;
 }