Skip to content

Commit 53a2a35

Browse files
authored
Merge pull request #136 from Azure-Samples/jmprieur/updatingToUseMicrosoftIdentityWebAsNuGet
Updating the first three projects to Microsoft.Identity.Web as a NuGet
2 parents d315eb6 + 1b912de commit 53a2a35

File tree

71 files changed

+143
-3969
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

71 files changed

+143
-3969
lines changed

1. Desktop app calls Web API/Desktop-App-calls-Web-API.sln

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1212
README.md = README.md
1313
EndProjectSection
1414
EndProject
15-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Web", "..\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj", "{F29C8FF6-5725-4C26-B0B4-682FCF218E6D}"
16-
EndProject
1715
Global
1816
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1917
Debug|Any CPU = Debug|Any CPU
@@ -28,10 +26,6 @@ Global
2826
{443FB1A8-4F29-4D18-A4EB-23C3D764580C}.Debug|Any CPU.Build.0 = Debug|Any CPU
2927
{443FB1A8-4F29-4D18-A4EB-23C3D764580C}.Release|Any CPU.ActiveCfg = Release|Any CPU
3028
{443FB1A8-4F29-4D18-A4EB-23C3D764580C}.Release|Any CPU.Build.0 = Release|Any CPU
31-
{F29C8FF6-5725-4C26-B0B4-682FCF218E6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
32-
{F29C8FF6-5725-4C26-B0B4-682FCF218E6D}.Debug|Any CPU.Build.0 = Debug|Any CPU
33-
{F29C8FF6-5725-4C26-B0B4-682FCF218E6D}.Release|Any CPU.ActiveCfg = Release|Any CPU
34-
{F29C8FF6-5725-4C26-B0B4-682FCF218E6D}.Release|Any CPU.Build.0 = Release|Any CPU
3529
EndGlobalSection
3630
GlobalSection(SolutionProperties) = preSolution
3731
HideSolutionNode = FALSE

1. Desktop app calls Web API/TodoListClient/App.config

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
<add key="ida:Tenant" value="organizations"/>
2323

2424
<!--
25-
ClientID (ApplicationID) of your application as registered in the App Registration (Preview) under Azure Active Directory
25+
ClientID (ApplicationID) of your application as registered in the App Registration under Azure Active Directory
2626
in https://portal.azure.com
2727
-->
2828
<add key="ida:ClientId" value="[Enter_client_ID_Of_TodoListClient-v2_from_Azure_Portal,_e.g._784d7a5a-4a49-4d1d-b328-5812070f366f]"/>

1. Desktop app calls Web API/TodoListClient/TodoListClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
</ItemGroup>
110110
<ItemGroup>
111111
<PackageReference Include="Microsoft.Identity.Client">
112-
<Version>4.7.1</Version>
112+
<Version>4.11.0</Version>
113113
</PackageReference>
114114
<PackageReference Include="Newtonsoft.Json">
115115
<Version>11.0.2</Version>

1. Desktop app calls Web API/TodoListService/TodoListService.csproj

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,6 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Authentication.AzureAD.UI" Version="3.1.0" />
11-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.0" Condition="'$(Configuration)' == 'Debug'" />
12-
</ItemGroup>
13-
14-
<ItemGroup>
15-
<ProjectReference Include="..\..\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj" />
10+
<PackageReference Include="Microsoft.Identity.Web" Version="0.1.0-preview" />
1611
</ItemGroup>
1712
</Project>

2. Web API now calls Microsoft Graph/TodoListClient/TodoListClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
</ItemGroup>
110110
<ItemGroup>
111111
<PackageReference Include="Microsoft.Identity.Client">
112-
<Version>4.8.2</Version>
112+
<Version>4.11.0</Version>
113113
</PackageReference>
114114
<PackageReference Include="Newtonsoft.Json">
115115
<Version>11.0.2</Version>

2. Web API now calls Microsoft Graph/TodoListService/Controllers/TodoListController.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public async Task<string> CallGraphApiOnBehalfOfUser()
9292
// we use MSAL.NET to get a token to call the API On Behalf Of the current user
9393
try
9494
{
95-
string accessToken = await _tokenAcquisition.GetAccessTokenOnBehalfOfUserAsync(scopes);
95+
string accessToken = await _tokenAcquisition.GetAccessTokenForUserAsync(scopes);
9696
dynamic me = await CallGraphApiOnBehalfOfUser(accessToken);
9797
return me.userPrincipalName;
9898
}

2. Web API now calls Microsoft Graph/TodoListService/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public Startup(IConfiguration configuration)
2424
public void ConfigureServices(IServiceCollection services)
2525
{
2626
services.AddProtectedWebApi(Configuration)
27-
.AddProtectedApiCallsWebApis(Configuration)
27+
.AddProtectedWebApiCallsProtectedWebApi(Configuration)
2828
.AddInMemoryTokenCaches();
2929
services.AddControllers();
3030
}

2. Web API now calls Microsoft Graph/TodoListService/TodoListService.csproj

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,11 @@
77
</PropertyGroup>
88

99
<ItemGroup>
10-
<PackageReference Include="Microsoft.AspNetCore.Authentication.AzureAD.UI" Version="3.1.0" />
11-
<!--<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.1" Condition="'$(Configuration)' == 'Debug'" />-->
12-
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="3.1.0" />
13-
</ItemGroup>
14-
15-
<ItemGroup>
16-
<ProjectReference Include="..\..\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj" />
10+
<None Include="wwwroot\index.html" />
1711
</ItemGroup>
1812

1913
<ItemGroup>
20-
<None Include="wwwroot\index.html" />
14+
<PackageReference Include="Microsoft.Identity.Web" Version="0.1.0-preview" />
2115
</ItemGroup>
2216

2317
</Project>

2. Web API now calls Microsoft Graph/Web-API-Calls-Graph.sln

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
1212
README.md = README.md
1313
EndProjectSection
1414
EndProject
15-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Web", "..\Microsoft.Identity.Web\Microsoft.Identity.Web.csproj", "{BAF87009-6850-487B-A9AA-65641C5472B4}"
16-
EndProject
17-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Web.Test", "..\Microsoft.Identity.Web.Test\Microsoft.Identity.Web.Test.csproj", "{685C401B-9945-4A24-8487-330C359F44EB}"
18-
EndProject
1915
Global
2016
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2117
Debug|Any CPU = Debug|Any CPU
@@ -30,14 +26,6 @@ Global
3026
{443FB1A8-4F29-4D18-A4EB-23C3D764580C}.Debug|Any CPU.Build.0 = Debug|Any CPU
3127
{443FB1A8-4F29-4D18-A4EB-23C3D764580C}.Release|Any CPU.ActiveCfg = Release|Any CPU
3228
{443FB1A8-4F29-4D18-A4EB-23C3D764580C}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{BAF87009-6850-487B-A9AA-65641C5472B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
34-
{BAF87009-6850-487B-A9AA-65641C5472B4}.Debug|Any CPU.Build.0 = Debug|Any CPU
35-
{BAF87009-6850-487B-A9AA-65641C5472B4}.Release|Any CPU.ActiveCfg = Release|Any CPU
36-
{BAF87009-6850-487B-A9AA-65641C5472B4}.Release|Any CPU.Build.0 = Release|Any CPU
37-
{685C401B-9945-4A24-8487-330C359F44EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
38-
{685C401B-9945-4A24-8487-330C359F44EB}.Debug|Any CPU.Build.0 = Debug|Any CPU
39-
{685C401B-9945-4A24-8487-330C359F44EB}.Release|Any CPU.ActiveCfg = Release|Any CPU
40-
{685C401B-9945-4A24-8487-330C359F44EB}.Release|Any CPU.Build.0 = Release|Any CPU
4129
EndGlobalSection
4230
GlobalSection(SolutionProperties) = preSolution
4331
HideSolutionNode = FALSE

3.-Web-api-call-Microsoft-graph-for-personal-accounts/TodoListClient/TodoListClient.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109
</ItemGroup>
110110
<ItemGroup>
111111
<PackageReference Include="Microsoft.Identity.Client">
112-
<Version>4.7.1</Version>
112+
<Version>4.11.0</Version>
113113
</PackageReference>
114114
<PackageReference Include="Newtonsoft.Json">
115115
<Version>11.0.2</Version>

0 commit comments

Comments
 (0)