From 75cafd188c6df71c9e329d64f7cb773c4907e9c3 Mon Sep 17 00:00:00 2001 From: Christian Wade Date: Sun, 1 Dec 2019 19:46:10 -0800 Subject: [PATCH] Cleaned up --- RestApiSample/RestApiSample/App.config | 4 +- RestApiSample/RestApiSample/Program.cs | 6 +-- .../RestApiSample/RestApiSample.csproj | 54 ++++++++++++++++--- RestApiSample/RestApiSample/packages.config | 10 +++- 4 files changed, 59 insertions(+), 15 deletions(-) diff --git a/RestApiSample/RestApiSample/App.config b/RestApiSample/RestApiSample/App.config index eb51eb6..450238c 100644 --- a/RestApiSample/RestApiSample/App.config +++ b/RestApiSample/RestApiSample/App.config @@ -1,7 +1,7 @@  - + @@ -11,4 +11,4 @@ - \ No newline at end of file + diff --git a/RestApiSample/RestApiSample/Program.cs b/RestApiSample/RestApiSample/Program.cs index a20fd08..d5a74e2 100644 --- a/RestApiSample/RestApiSample/Program.cs +++ b/RestApiSample/RestApiSample/Program.cs @@ -66,8 +66,7 @@ namespace RestApiSample { string resourceURI = "https://*.asazure.windows.net"; - //string authority = "https://login.windows.net//oauth2/authorize"; - string authority = "https://login.windows.net/72f988bf-86f1-41af-91ab-2d7cd011db47/oauth2/authorize"; // Authority address can optionally use tenant ID in place of "common". If service principal or B2B enabled, this is a requirement. + string authority = "https://login.windows.net//oauth2/authorize"; AuthenticationContext ac = new AuthenticationContext(authority); #region Interactive or username/password @@ -84,8 +83,7 @@ namespace RestApiSample #endregion //Service principal: - //ClientCredential cred = new ClientCredential("", ""); - ClientCredential cred = new ClientCredential("99ae7bd1-6b02-425f-928e-97baa957d3f1", "0T8BYov1JciG+q3B4bB4bY8EbBjWpY7aC3OBp0u9tj8="); + ClientCredential cred = new ClientCredential("", ""); AuthenticationResult ar = await ac.AcquireTokenAsync(resourceURI, cred); return ar.AccessToken; diff --git a/RestApiSample/RestApiSample/RestApiSample.csproj b/RestApiSample/RestApiSample/RestApiSample.csproj index 14a6b0d..5c2146b 100644 --- a/RestApiSample/RestApiSample/RestApiSample.csproj +++ b/RestApiSample/RestApiSample/RestApiSample.csproj @@ -8,9 +8,10 @@ Exe RestApiSample RestApiSample - v4.6.1 + v4.7.2 512 true + AnyCPU @@ -32,23 +33,60 @@ 4 - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.17.2\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll - - - ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.3.17.2\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.Platform.dll + + ..\packages\Microsoft.IdentityModel.Clients.ActiveDirectory.5.2.4\lib\net45\Microsoft.IdentityModel.Clients.ActiveDirectory.dll ..\packages\Newtonsoft.Json.10.0.3\lib\net45\Newtonsoft.Json.dll + - + + + + ..\packages\System.IO.4.3.0\lib\net462\System.IO.dll + True + True + + + ..\packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll + True + True + + + ..\packages\Microsoft.AspNet.WebApi.Client.5.2.7\lib\net45\System.Net.Http.Formatting.dll + + + ..\packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll + True + True + + + ..\packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll + True + True + + + ..\packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll + True + True + + + ..\packages\System.Security.Cryptography.Primitives.4.3.0\lib\net46\System.Security.Cryptography.Primitives.dll + True + True + + + ..\packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + True + True + + - diff --git a/RestApiSample/RestApiSample/packages.config b/RestApiSample/RestApiSample/packages.config index d101344..6838abf 100644 --- a/RestApiSample/RestApiSample/packages.config +++ b/RestApiSample/RestApiSample/packages.config @@ -1,5 +1,13 @@  - + + + + + + + + + \ No newline at end of file