ADAL to MSAL Migration (#75)
* updated samples for SOE and modern AVS changes. Successful build dependent upon release of new version of Partner Center SDK. * removed examples for synchronous qualification APIs * resolving build errors and updating package * shifted from ADAL implementation for generating userToken to MSAL implementation * removed ADAL dependency from CPVApplication and CSP Application projects * changed README.md with updated instructions to setup SDKSamples Co-authored-by: Gaurav Karna <gauravkarna@microsoft.com>
This commit is contained in:
Родитель
89317296df
Коммит
92c645d576
|
@ -37,8 +37,11 @@ Perform the following task to correctly configure the Azure AD application for u
|
|||
4. Sign in to the [Azure management portal](https://portal.azure.com) using the same credentials from step 1.
|
||||
5. Click on the _Azure Active Directory_ icon in the toolbar.
|
||||
6. Click _App registrations_ -> Select _All apps_ from the drop down -> Click on the application created in step 3.
|
||||
7. Click _Settings_ and then click _Redirect URIs_
|
||||
8. Add **urn:ietf:wg:oauth:2.0:oob** as one of the available Redirect URIs. Be sure to click the _Save_ button to ensure the changes are saved.
|
||||
7. Click _Authentication_ from left menu blade and then click _Add Platform_
|
||||
8. In the Right popup blade, Click on _Mobile and Desktop Applications_
|
||||
8. Select **https://login.microsoftonline.com/common/oauth2/nativeclient** as one of the available Redirect URIs ( You need to add a custom redirectUri too. Add **http://localhost** but we will be using the one added earlier ).
|
||||
9. Click _Configure_. Your set of redirect Uris will be added under Platform **Mobile and Desktop Applications**.
|
||||
10. Be sure to click the _Save_ button to ensure the changes are saved.
|
||||
|
||||
## What to Change
|
||||
|
||||
|
@ -65,6 +68,7 @@ The following settings must be modified, so that each scenario functions as exce
|
|||
The following settings must be updated, so that each scenario functions as expected
|
||||
|
||||
- **ApplicationId**: Your Azure Active Directory application identifier, used for authentication
|
||||
- **Domain**: The Azure Active Directory domain where the Azure AD application was created
|
||||
|
||||
Do not change the following configurations
|
||||
|
||||
|
|
|
@ -22,10 +22,15 @@
|
|||
<UserAuthentication>
|
||||
<!-- The active directory application ID used by the user login, paste your application ID here. -->
|
||||
<add key="ApplicationId" value="" />
|
||||
<!-- The active directory domain on which the application is hosted. Paste your domain here.
|
||||
If domain is kept blank, the commonDomain will be used. For that you need to declare your AAD Application as multitenant
|
||||
which will further require the admin of the tenant of the user being logged in to consent for the scopes he is trying to generate the token against-->
|
||||
<add key="Domain" value="" />
|
||||
<!-- The resource the application is attempting to access i.e. the partner API service. -->
|
||||
<!-- This value must NOT end with a trailing '/'. -->
|
||||
<add key="ResourceUrl" value="https://api.partnercenter.microsoft.com" />
|
||||
<add key="RedirectUrl" value="http://localhost" />
|
||||
<!-- You will need to enable Authentication for Mobile and Desktop applications and whitelist this RedirectUri for your AAD Application-->
|
||||
<add key="RedirectUrl" value="https://login.microsoftonline.com/common/oauth2/nativeclient" />
|
||||
</UserAuthentication>
|
||||
|
||||
<AppAuthentication>
|
||||
|
|
|
@ -32,6 +32,17 @@ namespace Microsoft.Store.PartnerCenter.Samples.Configuration
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets AAD Domain which hosts the application.
|
||||
/// </summary>
|
||||
public string Domain
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ConfigurationSection["Domain"];
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the resource the application is attempting to access, i.e. the partner API service.
|
||||
/// </summary>
|
||||
|
|
|
@ -7,11 +7,12 @@
|
|||
namespace Microsoft.Store.PartnerCenter.Samples.Context
|
||||
{
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Configuration;
|
||||
using Extensions;
|
||||
using Helpers;
|
||||
using IdentityModel.Clients.ActiveDirectory;
|
||||
using Identity.Client;
|
||||
|
||||
/// <summary>
|
||||
/// Scenario context implementation class.
|
||||
|
@ -91,7 +92,7 @@ namespace Microsoft.Store.PartnerCenter.Samples.Context
|
|||
{
|
||||
this.ConsoleHelper.StartProgress("Authenticating user");
|
||||
|
||||
AuthenticationResult aadAuthenticationResult = this.LoginUserToAad();
|
||||
AuthenticationResult aadAuthenticationResult = Task.Run(() => this.LoginUserToAad()).Result;
|
||||
|
||||
// Authenticate by user context with the partner service
|
||||
IPartnerCredentials userCredentials = PartnerCredentials.Instance.GenerateByUserCredentials(
|
||||
|
@ -103,7 +104,7 @@ namespace Microsoft.Store.PartnerCenter.Samples.Context
|
|||
{
|
||||
// token has expired, re-Login to Azure Active Directory
|
||||
this.ConsoleHelper.StartProgress("Token expired. Re-authenticating user");
|
||||
AuthenticationResult aadToken = this.LoginUserToAad();
|
||||
AuthenticationResult aadToken = Task.Run(() => this.LoginUserToAad()).Result;
|
||||
this.ConsoleHelper.StopProgress();
|
||||
|
||||
// give the partner SDK the new add token information
|
||||
|
@ -124,21 +125,47 @@ namespace Microsoft.Store.PartnerCenter.Samples.Context
|
|||
/// Logs in to AAD as a user and obtains the user authentication token.
|
||||
/// </summary>
|
||||
/// <returns>The user authentication result.</returns>
|
||||
private AuthenticationResult LoginUserToAad()
|
||||
private async Task<AuthenticationResult> LoginUserToAad()
|
||||
{
|
||||
UriBuilder addAuthority = new UriBuilder(this.Configuration.PartnerService.AuthenticationAuthorityEndpoint)
|
||||
var tenantDomain = string.IsNullOrWhiteSpace(Configuration.UserAuthentication.Domain) ? this.Configuration.PartnerService.CommonDomain : this.Configuration.UserAuthentication.Domain;
|
||||
|
||||
var scopes = new string[] { $"{Configuration.UserAuthentication.ResourceUrl.OriginalString}/.default" };
|
||||
AuthenticationResult result = null;
|
||||
|
||||
var app = PublicClientApplicationBuilder.Create(Configuration.UserAuthentication.ApplicationId)
|
||||
.WithAuthority(this.Configuration.PartnerService.AuthenticationAuthorityEndpoint.OriginalString, tenantDomain, true)
|
||||
.WithRedirectUri(this.Configuration.UserAuthentication.RedirectUrl.OriginalString)
|
||||
.Build();
|
||||
|
||||
var accounts = await app.GetAccountsAsync();
|
||||
|
||||
try
|
||||
{
|
||||
Path = this.Configuration.PartnerService.CommonDomain
|
||||
};
|
||||
result = await app.AcquireTokenSilent(scopes, accounts.FirstOrDefault())
|
||||
.ExecuteAsync();
|
||||
}
|
||||
catch (MsalUiRequiredException ex)
|
||||
{
|
||||
// A MsalUiRequiredException happened on AcquireTokenSilent.
|
||||
// This indicates you need to call AcquireTokenInteractive to acquire a token
|
||||
System.Diagnostics.Debug.WriteLine($"MsalUiRequiredException: {ex.Message}");
|
||||
|
||||
AuthenticationContext authContext = new AuthenticationContext(addAuthority.Uri.AbsoluteUri);
|
||||
try
|
||||
{
|
||||
result = await app.AcquireTokenInteractive(scopes)
|
||||
.ExecuteAsync();
|
||||
}
|
||||
catch (MsalException msalex)
|
||||
{
|
||||
throw msalex;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw ex;
|
||||
}
|
||||
|
||||
return Task.Run(() => authContext.AcquireTokenAsync(
|
||||
Configuration.UserAuthentication.ResourceUrl.OriginalString,
|
||||
Configuration.UserAuthentication.ApplicationId,
|
||||
redirectUri,
|
||||
new PlatformParameters(PromptBehavior.Always),
|
||||
UserIdentifier.AnyUser)).Result;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -32,7 +32,14 @@ namespace Microsoft.Store.PartnerCenter.Samples.Customers
|
|||
var partnerOperations = this.Context.UserPartnerOperations;
|
||||
this.Context.ConsoleHelper.StartProgress("Creating customer qualification");
|
||||
|
||||
var customerQualification = new Models.Customers.V2.CustomerQualification { Qualification = "education" };
|
||||
/* This variable can be set to any allowed qualification, for example:
|
||||
* (1) "education"
|
||||
* (2) "GovernmentCommunityCloud" <- this has to be paired with a ValidationCode, see sample in "CreateCustomerQualificationWithGCC.cs"
|
||||
* (3) "StateOwnedEntity"
|
||||
*/
|
||||
var qualificationToCreate = "education";
|
||||
|
||||
var customerQualification = new Models.Customers.V2.CustomerQualification { Qualification = qualificationToCreate };
|
||||
|
||||
var createCustomerQualification = partnerOperations.Customers.ById(customerIdToRetrieve).Qualification.CreateQualifications(customerQualification);
|
||||
|
||||
|
|
|
@ -1,38 +0,0 @@
|
|||
// -----------------------------------------------------------------------
|
||||
// <copyright file="GetCustomerQualification.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Store.PartnerCenter.Samples.Customers
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets a single customer qualification.
|
||||
/// </summary>
|
||||
public class GetCustomerQualification : BasePartnerScenario
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="GetCustomerQualification"/> class.
|
||||
/// </summary>
|
||||
/// <param name="context">The scenario context.</param>
|
||||
public GetCustomerQualification(IScenarioContext context) : base("Get customer qualification", context)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes the get customer qualification scenario.
|
||||
/// </summary>
|
||||
protected override void RunScenario()
|
||||
{
|
||||
string customerIdToRetrieve = this.ObtainCustomerId("Enter the ID of the customer to retrieve qualification for");
|
||||
|
||||
var partnerOperations = this.Context.UserPartnerOperations;
|
||||
this.Context.ConsoleHelper.StartProgress("Retrieving customer qualification");
|
||||
|
||||
var customerQualification = partnerOperations.Customers.ById(customerIdToRetrieve).Qualification.Get();
|
||||
|
||||
this.Context.ConsoleHelper.StopProgress();
|
||||
this.Context.ConsoleHelper.WriteObject(customerQualification, "Customer Qualification");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,42 +0,0 @@
|
|||
// -----------------------------------------------------------------------
|
||||
// <copyright file="UpdateCustomerQualification.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Store.PartnerCenter.Samples.Customers
|
||||
{
|
||||
using Microsoft.Store.PartnerCenter.Models.Customers;
|
||||
|
||||
/// <summary>
|
||||
/// Updates a single customer qualification.
|
||||
/// </summary>
|
||||
public class UpdateCustomerQualification : BasePartnerScenario
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UpdateCustomerQualification"/> class.
|
||||
/// </summary>
|
||||
/// <param name="context">The scenario context.</param>
|
||||
public UpdateCustomerQualification(IScenarioContext context) : base("Update customer qualification", context)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes the update customer qualification scenario.
|
||||
/// </summary>
|
||||
protected override void RunScenario()
|
||||
{
|
||||
string customerIdToRetrieve = this.ObtainCustomerId($"Enter the ID of the customer to update qualification to {CustomerQualification.Education}");
|
||||
|
||||
var partnerOperations = this.Context.UserPartnerOperations;
|
||||
this.Context.ConsoleHelper.StartProgress("Updating customer qualification");
|
||||
|
||||
var customerQualification =
|
||||
partnerOperations.Customers.ById(customerIdToRetrieve)
|
||||
.Qualification.Update(CustomerQualification.Education);
|
||||
|
||||
this.Context.ConsoleHelper.StopProgress();
|
||||
this.Context.ConsoleHelper.WriteObject(customerQualification, "Customer Qualification");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
// -----------------------------------------------------------------------
|
||||
// <copyright file="UpdateCustomerQualificationWithGCC.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
namespace Microsoft.Store.PartnerCenter.Samples.Customers
|
||||
{
|
||||
using Microsoft.Store.PartnerCenter.Models.Customers;
|
||||
using Microsoft.Store.PartnerCenter.Models.ValidationCodes;
|
||||
using System.Collections.Generic;
|
||||
|
||||
/// <summary>
|
||||
/// Updates a single customer qualification to GCC.
|
||||
/// </summary>
|
||||
public class UpdateCustomerQualificationWithGCC : BasePartnerScenario
|
||||
{
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="UpdateCustomerQualificationWithGCC"/> class.
|
||||
/// </summary>
|
||||
/// <param name="context">The scenario context.</param>
|
||||
public UpdateCustomerQualificationWithGCC(IScenarioContext context) : base("Update customer qualification with GCC", context)
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes the update customer qualification scenario.
|
||||
/// </summary>
|
||||
protected override void RunScenario()
|
||||
{
|
||||
string customerIdToRetrieve = this.ObtainCustomerId($"Enter the ID of the customer to update qualification to {CustomerQualification.GovernmentCommunityCloud}");
|
||||
|
||||
var partnerOperations = this.Context.UserPartnerOperations;
|
||||
|
||||
this.Context.ConsoleHelper.StartProgress("Retrieving validation codes");
|
||||
var validations = partnerOperations.Validations.GetValidationCodes();
|
||||
this.Context.ConsoleHelper.StopProgress();
|
||||
|
||||
this.Context.ConsoleHelper.Success("Success!");
|
||||
|
||||
this.Context.ConsoleHelper.WriteObject(validations, "Validations");
|
||||
|
||||
string validationCodeToRetrieve = this.ObtainQuantity("Enter validation code to use by ValidationId");
|
||||
|
||||
ValidationCode code = null;
|
||||
|
||||
foreach(ValidationCode c in validations)
|
||||
{
|
||||
if(c.ValidationId == validationCodeToRetrieve)
|
||||
{
|
||||
code = c;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(code == null)
|
||||
{
|
||||
this.Context.ConsoleHelper.Error("Code not found");
|
||||
}
|
||||
|
||||
this.Context.ConsoleHelper.StartProgress("Updating customer qualification");
|
||||
|
||||
|
||||
var customerQualification =
|
||||
partnerOperations.Customers.ById(customerIdToRetrieve)
|
||||
.Qualification.Update(CustomerQualification.GovernmentCommunityCloud, code);
|
||||
|
||||
this.Context.ConsoleHelper.StopProgress();
|
||||
this.Context.ConsoleHelper.WriteObject(customerQualification, "Customer Qualification");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -238,10 +238,7 @@ namespace Microsoft.Store.PartnerCenter.Samples
|
|||
new GetPagedCustomers(context, context.Configuration.Scenario.CustomerPageSize),
|
||||
new AggregatePartnerScenario("Customer filtering", customerFilteringScenarios, context),
|
||||
new GetCustomerDetails(context),
|
||||
new GetCustomerQualification(context),
|
||||
new GetCustomerQualifications(context),
|
||||
new UpdateCustomerQualification(context),
|
||||
new UpdateCustomerQualificationWithGCC(context),
|
||||
new CreateCustomerQualification(context),
|
||||
new CreateCustomerQualificationWithGCC(context),
|
||||
new DeleteCustomerFromTipAccount(context),
|
||||
|
|
|
@ -42,17 +42,17 @@
|
|||
<DocumentationFile>bin\Release\Microsoft.Store.PartnerCenter.Samples.xml</DocumentationFile>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.0\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
<Reference Include="Microsoft.Identity.Client, Version=4.31.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Identity.Client.4.31.0\lib\net461\Microsoft.Identity.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter, Version=1.17.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.17.0\lib\netstandard2.0\Microsoft.Store.PartnerCenter.dll</HintPath>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter, Version=2.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.2.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Extensions, Version=1.17.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.17.0\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Extensions.dll</HintPath>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Extensions, Version=2.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.2.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Models, Version=1.17.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.17.0\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Models.dll</HintPath>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Models, Version=2.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.2.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Models.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
|
@ -136,9 +136,7 @@
|
|||
<Compile Include="Customers\CreateCustomerQualification.cs" />
|
||||
<Compile Include="Customers\CreateCustomerQualificationWithGCC.cs" />
|
||||
<Compile Include="Customers\DeletePartnerCustomerRelationship.cs" />
|
||||
<Compile Include="Customers\GetCustomerQualification.cs" />
|
||||
<Compile Include="Customers\GetCustomerQualifications.cs" />
|
||||
<Compile Include="Customers\UpdateCustomerQualification.cs" />
|
||||
<Compile Include="Customers\UpdateCustomerBillingProfile.cs" />
|
||||
<Compile Include="Customers\GetCustomerManagedServices.cs" />
|
||||
<Compile Include="Customers\FilterCustomers.cs" />
|
||||
|
@ -148,7 +146,6 @@
|
|||
<Compile Include="Customers\GetCustomerDetails.cs" />
|
||||
<Compile Include="Customers\CheckDomainAvailability.cs" />
|
||||
<Compile Include="Customers\CreateCustomer.cs" />
|
||||
<Compile Include="Customers\UpdateCustomerQualificationWithGCC.cs" />
|
||||
<Compile Include="Customers\ValidateCustomerAddress.cs" />
|
||||
<Compile Include="CustomerUser\CreateCustomerUser.cs" />
|
||||
<Compile Include="CustomerUser\CustomerUserAssignedGroup1AndGroup2Licenses.cs" />
|
||||
|
|
|
@ -6,7 +6,10 @@
|
|||
|
||||
namespace Microsoft.Store.PartnerCenter.Samples.Validations
|
||||
{
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Models;
|
||||
|
||||
/// <summary>
|
||||
|
@ -41,32 +44,30 @@ namespace Microsoft.Store.PartnerCenter.Samples.Validations
|
|||
};
|
||||
|
||||
this.Context.ConsoleHelper.StartProgress("Validating address");
|
||||
var addressValidationResult = partnerOperations.Validations.IsAddressValid(address);
|
||||
this.Context.ConsoleHelper.StopProgress();
|
||||
|
||||
try
|
||||
{
|
||||
// Validate the address
|
||||
var validationResult = partnerOperations.Validations.IsAddressValidAsync(address).Result;
|
||||
this.Context.ConsoleHelper.StopProgress();
|
||||
Console.WriteLine(validationResult ? "The address is valid." : "Invalid address");
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
this.Context.ConsoleHelper.StopProgress();
|
||||
Console.WriteLine("Address is invalid");
|
||||
var innerException = exception.InnerException;
|
||||
if (innerException != null)
|
||||
{
|
||||
while (innerException != null)
|
||||
{
|
||||
this.Context.ConsoleHelper.WriteObject(innerException.Message);
|
||||
innerException = innerException.InnerException;
|
||||
}
|
||||
}
|
||||
else if (!string.IsNullOrWhiteSpace(exception.Message))
|
||||
{
|
||||
this.Context.ConsoleHelper.WriteObject(exception.Message);
|
||||
}
|
||||
Console.WriteLine($"Status: {addressValidationResult.Status}");
|
||||
Console.WriteLine($"Original Address:\n{this.DisplayAddress(addressValidationResult.OriginalAddress)}");
|
||||
Console.WriteLine($"Validation Message Returned: {addressValidationResult.ValidationMessage ?? "No message returned."}");
|
||||
Console.WriteLine($"Suggested Addresses Returned: {addressValidationResult.SuggestedAddresses?.Count}");
|
||||
|
||||
if (addressValidationResult.SuggestedAddresses != null && addressValidationResult.SuggestedAddresses.Any())
|
||||
{
|
||||
addressValidationResult.SuggestedAddresses.ForEach(a => Console.WriteLine(this.DisplayAddress(a)));
|
||||
}
|
||||
}
|
||||
|
||||
private string DisplayAddress(Address address)
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
foreach (var property in address.GetType().GetProperties())
|
||||
{
|
||||
sb.AppendLine($"{property.Name}: {property.GetValue(address) ?? "None to Display."}");
|
||||
}
|
||||
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="5.2.0" targetFramework="net461" />
|
||||
<package id="Microsoft.Store.PartnerCenter" version="1.17.0" targetFramework="net461" />
|
||||
<package id="Microsoft.Identity.Client" version="4.31.0" targetFramework="net461" />
|
||||
<package id="Microsoft.Store.PartnerCenter" version="2.0.1" targetFramework="net461" />
|
||||
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
|
||||
<package id="System.ComponentModel.Annotations" version="4.7.0" targetFramework="net461" />
|
||||
<package id="System.Data.DataSetExtensions" version="4.5.0" targetFramework="net461" />
|
||||
|
|
|
@ -30,10 +30,6 @@
|
|||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
|
@ -42,6 +38,10 @@
|
|||
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.1.3" newVersion="4.1.1.3" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
|
@ -38,8 +38,8 @@
|
|||
<Reference Include="Microsoft.Azure.KeyVault.WebKey, Version=3.0.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Azure.KeyVault.WebKey.3.0.4\lib\net461\Microsoft.Azure.KeyVault.WebKey.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.0\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
<Reference Include="Microsoft.Identity.Client, Version=4.31.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Identity.Client.4.31.0\lib\net461\Microsoft.Identity.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Rest.ClientRuntime.2.3.20\lib\net461\Microsoft.Rest.ClientRuntime.dll</HintPath>
|
||||
|
@ -47,19 +47,23 @@
|
|||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.19\lib\net461\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter, Version=1.13.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.13.1\lib\Net45\Microsoft.Store.PartnerCenter.dll</HintPath>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter, Version=2.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.2.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Extensions, Version=1.13.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.13.1\lib\Net45\Microsoft.Store.PartnerCenter.Extensions.dll</HintPath>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Extensions, Version=2.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.2.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Models, Version=1.13.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.13.1\lib\Net45\Microsoft.Store.PartnerCenter.Models.dll</HintPath>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Models, Version=2.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.2.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Models.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ComponentModel.Annotations.4.7.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
<packages>
|
||||
<package id="Microsoft.Azure.KeyVault" version="3.0.4" targetFramework="net461" />
|
||||
<package id="Microsoft.Azure.KeyVault.WebKey" version="3.0.4" targetFramework="net461" />
|
||||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="5.2.0" targetFramework="net461" />
|
||||
<package id="Microsoft.Identity.Client" version="4.31.0" targetFramework="net461" />
|
||||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.20" targetFramework="net461" />
|
||||
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.19" targetFramework="net461" />
|
||||
<package id="Microsoft.Store.PartnerCenter" version="1.13.1" targetFramework="net461" />
|
||||
<package id="Microsoft.Store.PartnerCenter" version="2.0.1" targetFramework="net461" />
|
||||
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
|
||||
<package id="System.ComponentModel.Annotations" version="4.7.0" targetFramework="net461" />
|
||||
<package id="System.Data.DataSetExtensions" version="4.5.0" targetFramework="net461" />
|
||||
<package id="System.Net.Http" version="4.3.4" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
|
||||
|
|
|
@ -29,10 +29,6 @@
|
|||
</startup>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.IdentityModel.Clients.ActiveDirectory" publicKeyToken="31bf3856ad364e35" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-5.2.0.0" newVersion="5.2.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-12.0.0.0" newVersion="12.0.0.0" />
|
||||
|
@ -41,6 +37,10 @@
|
|||
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.1.1.3" newVersion="4.1.1.3" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.ComponentModel.Annotations" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-4.2.1.0" newVersion="4.2.1.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
|
@ -38,8 +38,8 @@
|
|||
<Reference Include="Microsoft.Azure.KeyVault.WebKey, Version=3.0.4.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Azure.KeyVault.WebKey.3.0.4\lib\net461\Microsoft.Azure.KeyVault.WebKey.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.IdentityModel.Clients.ActiveDirectory, Version=5.2.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.0\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll</HintPath>
|
||||
<Reference Include="Microsoft.Identity.Client, Version=4.31.0.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Identity.Client.4.31.0\lib\net461\Microsoft.Identity.Client.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Rest.ClientRuntime, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Rest.ClientRuntime.2.3.20\lib\net461\Microsoft.Rest.ClientRuntime.dll</HintPath>
|
||||
|
@ -47,19 +47,23 @@
|
|||
<Reference Include="Microsoft.Rest.ClientRuntime.Azure, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Rest.ClientRuntime.Azure.3.3.19\lib\net461\Microsoft.Rest.ClientRuntime.Azure.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter, Version=1.13.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.13.1\lib\Net45\Microsoft.Store.PartnerCenter.dll</HintPath>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter, Version=2.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.2.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Extensions, Version=1.13.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.13.1\lib\Net45\Microsoft.Store.PartnerCenter.Extensions.dll</HintPath>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Extensions, Version=2.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.2.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Models, Version=1.13.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.1.13.1\lib\Net45\Microsoft.Store.PartnerCenter.Models.dll</HintPath>
|
||||
<Reference Include="Microsoft.Store.PartnerCenter.Models, Version=2.0.1.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Store.PartnerCenter.2.0.1\lib\netstandard2.0\Microsoft.Store.PartnerCenter.Models.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=12.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Newtonsoft.Json.12.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.ComponentModel.Annotations, Version=4.2.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\System.ComponentModel.Annotations.4.7.0\lib\net461\System.ComponentModel.Annotations.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Drawing" />
|
||||
|
|
|
@ -2,11 +2,13 @@
|
|||
<packages>
|
||||
<package id="Microsoft.Azure.KeyVault" version="3.0.4" targetFramework="net461" />
|
||||
<package id="Microsoft.Azure.KeyVault.WebKey" version="3.0.4" targetFramework="net461" />
|
||||
<package id="Microsoft.IdentityModel.Clients.ActiveDirectory" version="5.2.0" targetFramework="net461" />
|
||||
<package id="Microsoft.Identity.Client" version="4.31.0" targetFramework="net461" />
|
||||
<package id="Microsoft.Rest.ClientRuntime" version="2.3.20" targetFramework="net461" />
|
||||
<package id="Microsoft.Rest.ClientRuntime.Azure" version="3.3.19" targetFramework="net461" />
|
||||
<package id="Microsoft.Store.PartnerCenter" version="1.13.1" targetFramework="net461" />
|
||||
<package id="Microsoft.Store.PartnerCenter" version="2.0.1" targetFramework="net461" />
|
||||
<package id="Newtonsoft.Json" version="12.0.2" targetFramework="net461" />
|
||||
<package id="System.ComponentModel.Annotations" version="4.7.0" targetFramework="net461" />
|
||||
<package id="System.Data.DataSetExtensions" version="4.5.0" targetFramework="net461" />
|
||||
<package id="System.Net.Http" version="4.3.4" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Algorithms" version="4.3.1" targetFramework="net461" />
|
||||
<package id="System.Security.Cryptography.Encoding" version="4.3.0" targetFramework="net461" />
|
||||
|
|
Загрузка…
Ссылка в новой задаче