diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 08b9de7..995c5ca 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,7 +16,7 @@ jobs: - name: Setup .NET uses: actions/setup-dotnet@v1 with: - dotnet-version: '7.0' + dotnet-version: '8.0' include-prerelease: True - name: Build AngularAzureADMultipleApis run: dotnet build ./AngularAzureADMultipleApis/ApiWithMutlipleApis.sln diff --git a/AngularAzureADMultipleApis/ApiWithMutlipleApis/ApiWithMutlipleApis.csproj b/AngularAzureADMultipleApis/ApiWithMutlipleApis/ApiWithMutlipleApis.csproj index 688389f..7193cdf 100644 --- a/AngularAzureADMultipleApis/ApiWithMutlipleApis/ApiWithMutlipleApis.csproj +++ b/AngularAzureADMultipleApis/ApiWithMutlipleApis/ApiWithMutlipleApis.csproj @@ -1,27 +1,27 @@  - net7.0 + net8.0 3e9ac996-8e75-4dd9-9a5b-27a6e01a3f3d enable enable - - - + + + - - + + - - + + - - - + + + diff --git a/AngularAzureADMultipleApis/ApiWithMutlipleApis/HostingExtensions.cs b/AngularAzureADMultipleApis/ApiWithMutlipleApis/HostingExtensions.cs index 7d622ef..b6f631a 100644 --- a/AngularAzureADMultipleApis/ApiWithMutlipleApis/HostingExtensions.cs +++ b/AngularAzureADMultipleApis/ApiWithMutlipleApis/HostingExtensions.cs @@ -3,9 +3,9 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc.Authorization; using Microsoft.Identity.Web; +using Microsoft.IdentityModel.JsonWebTokens; using Microsoft.IdentityModel.Logging; using Microsoft.OpenApi.Models; -using System.IdentityModel.Tokens.Jwt; namespace ApiWithMutlipleApis; @@ -93,7 +93,7 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde public static WebApplication ConfigurePipeline(this WebApplication app) { IdentityModelEventSource.ShowPII = true; - JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear(); + JsonWebTokenHandler.DefaultInboundClaimTypeMap.Clear(); app.UseSwagger(); app.UseSwaggerUI(c => diff --git a/AngularAzureADMultipleApis/ServiceApi/SecurityHeadersDefinitions.cs b/AngularAzureADMultipleApis/ServiceApi/SecurityHeadersDefinitions.cs index 7e13048..cc0c1dc 100644 --- a/AngularAzureADMultipleApis/ServiceApi/SecurityHeadersDefinitions.cs +++ b/AngularAzureADMultipleApis/ServiceApi/SecurityHeadersDefinitions.cs @@ -8,7 +8,6 @@ public static HeaderPolicyCollection GetHeaderPolicyCollection(bool isDev) { var policy = new HeaderPolicyCollection() .AddFrameOptionsDeny() - .AddXssProtectionBlock() .AddContentTypeOptionsNoSniff() .AddReferrerPolicyStrictOriginWhenCrossOrigin() .RemoveServerHeader() diff --git a/AngularAzureADMultipleApis/ServiceApi/ServiceApi.csproj b/AngularAzureADMultipleApis/ServiceApi/ServiceApi.csproj index e0840d6..5439c67 100644 --- a/AngularAzureADMultipleApis/ServiceApi/ServiceApi.csproj +++ b/AngularAzureADMultipleApis/ServiceApi/ServiceApi.csproj @@ -1,25 +1,25 @@  - net7.0 + net8.0 196b270c-b0c0-4b90-8f04-d3108e701d51 enable - + - - + + - - + + - - - + + + diff --git a/AngularAzureADMultipleApis/UserApi/UserApi.csproj b/AngularAzureADMultipleApis/UserApi/UserApi.csproj index 0a6bc84..7071290 100644 --- a/AngularAzureADMultipleApis/UserApi/UserApi.csproj +++ b/AngularAzureADMultipleApis/UserApi/UserApi.csproj @@ -1,14 +1,14 @@  - net7.0 + net8.0 aspnet-UserApiOne-2ba0bbf9-49f5-452e-8333-1e33a467b74e enable enable - + diff --git a/AppRoles/README_CONFIG.md b/AppRoles/README_CONFIG.md index c7536a0..8aaafd6 100644 --- a/AppRoles/README_CONFIG.md +++ b/AppRoles/README_CONFIG.md @@ -25,7 +25,7 @@ https://docs.microsoft.com/en-us/azure/active-directory/develop/access-tokens https://docs.microsoft.com/en-us/aspnet/core/security/authorization/policies -# Azure authorization +# Microsoft Entra ID authorization https://docs.microsoft.com/en-us/azure/role-based-access-control/overview diff --git a/AppRoles/WebApiWithRoles/WebApiWithRoles.csproj b/AppRoles/WebApiWithRoles/WebApiWithRoles.csproj index 920dc01..ebf986f 100644 --- a/AppRoles/WebApiWithRoles/WebApiWithRoles.csproj +++ b/AppRoles/WebApiWithRoles/WebApiWithRoles.csproj @@ -1,13 +1,13 @@  - net7.0 + net8.0 enable enable - + diff --git a/AppRoles/WebAppWithRoles/Pages/Index.cshtml b/AppRoles/WebAppWithRoles/Pages/Index.cshtml index 748f30d..b81aae9 100644 --- a/AppRoles/WebAppWithRoles/Pages/Index.cshtml +++ b/AppRoles/WebAppWithRoles/Pages/Index.cshtml @@ -1,10 +1,10 @@ @page @model IndexModel @{ - ViewData["Title"] = "Azure AD App roles"; + ViewData["Title"] = "Microsoft Entra ID App roles"; }
-

Azure AD authentication, authorization with roles

+

Microsoft Entra ID authentication, authorization with roles

Web App which accesses Web API with different roles

diff --git a/AppRoles/WebAppWithRoles/WebAppWithRoles.csproj b/AppRoles/WebAppWithRoles/WebAppWithRoles.csproj index 5bf5b11..4f49bbb 100644 --- a/AppRoles/WebAppWithRoles/WebAppWithRoles.csproj +++ b/AppRoles/WebAppWithRoles/WebAppWithRoles.csproj @@ -1,16 +1,16 @@  - net7.0 + net8.0 bdff93cf-79ea-4b5e-aeaf-ea1490d39566 enable enable - - - + + + diff --git a/BlazorBff/BlazorAzureAdBff/Client/BlazorAzureADWithApis.Client.csproj b/BlazorBff/BlazorAzureAdBff/Client/BlazorAzureADWithApis.Client.csproj index 4083370..cb43ed3 100644 --- a/BlazorBff/BlazorAzureAdBff/Client/BlazorAzureADWithApis.Client.csproj +++ b/BlazorBff/BlazorAzureAdBff/Client/BlazorAzureADWithApis.Client.csproj @@ -1,17 +1,17 @@  - net7.0 + net8.0 true enable enable - - - - + + + + diff --git a/BlazorBff/BlazorAzureAdBff/Server/BlazorAzureADWithApis.Server.csproj b/BlazorBff/BlazorAzureAdBff/Server/BlazorAzureADWithApis.Server.csproj index 9f90c4a..51441fa 100644 --- a/BlazorBff/BlazorAzureAdBff/Server/BlazorAzureADWithApis.Server.csproj +++ b/BlazorBff/BlazorAzureAdBff/Server/BlazorAzureADWithApis.Server.csproj @@ -1,14 +1,14 @@  - net7.0 + net8.0 enable 7b7a3ab3-3ad6-4820-a521-dcdaf28f15cb enable - + @@ -17,12 +17,12 @@ - - - - - - + + + + + + diff --git a/BlazorBff/BlazorAzureAdBff/Server/Controllers/GraphProfileController.cs b/BlazorBff/BlazorAzureAdBff/Server/Controllers/GraphProfileController.cs index a994ee8..b91105c 100644 --- a/BlazorBff/BlazorAzureAdBff/Server/Controllers/GraphProfileController.cs +++ b/BlazorBff/BlazorAzureAdBff/Server/Controllers/GraphProfileController.cs @@ -26,7 +26,7 @@ public GraphProfileController(MsGraphDelegatedService microsoftGraphDelegatedCli public async Task> Get() { var userData = await _microsoftGraphDelegatedClientService.GetGraphApiUser(); - return new List { $"DisplayName: {userData.DisplayName}", + return new List { $"DisplayName: {userData!.DisplayName}", $"GivenName: {userData.GivenName}", $"AboutMe: {userData.AboutMe}" }; } } diff --git a/BlazorBff/BlazorAzureAdBff/Server/Services/Application/MsGraphApplicationService.cs b/BlazorBff/BlazorAzureAdBff/Server/Services/Application/MsGraphApplicationService.cs index f20054a..f2dc17e 100644 --- a/BlazorBff/BlazorAzureAdBff/Server/Services/Application/MsGraphApplicationService.cs +++ b/BlazorBff/BlazorAzureAdBff/Server/Services/Application/MsGraphApplicationService.cs @@ -23,7 +23,7 @@ public MsGraphApplicationService(IConfiguration configuration) .GetAsync(); } - public async Task GetGraphApiUserMemberGroups(string userId) + public async Task GetGraphApiUserMemberGroups(string userId) { var graphServiceClient = GetGraphClient(); @@ -34,7 +34,7 @@ public MsGraphApplicationService(IConfiguration configuration) return await graphServiceClient.Users[userId] .GetMemberGroups - .PostAsync(requestBody); + .PostAsGetMemberGroupsPostResponseAsync(requestBody); } private GraphServiceClient GetGraphClient() { diff --git a/BlazorBff/BlazorAzureAdBff/Shared/BlazorAzureADWithApis.Shared.csproj b/BlazorBff/BlazorAzureAdBff/Shared/BlazorAzureADWithApis.Shared.csproj index 82e7f88..43e82e3 100644 --- a/BlazorBff/BlazorAzureAdBff/Shared/BlazorAzureADWithApis.Shared.csproj +++ b/BlazorBff/BlazorAzureAdBff/Shared/BlazorAzureADWithApis.Shared.csproj @@ -1,13 +1,13 @@  - net7.0 + net8.0 enable enable - + diff --git a/BlazorWithApis/BlazorAzureADWithApis/Client/BlazorAzureADWithApis.Client.csproj b/BlazorWithApis/BlazorAzureADWithApis/Client/BlazorAzureADWithApis.Client.csproj index cdcb40d..f40c4b6 100644 --- a/BlazorWithApis/BlazorAzureADWithApis/Client/BlazorAzureADWithApis.Client.csproj +++ b/BlazorWithApis/BlazorAzureADWithApis/Client/BlazorAzureADWithApis.Client.csproj @@ -1,18 +1,18 @@  - net7.0 + net8.0 service-worker-assets.js enable enable - - - - - + + + + + diff --git a/BlazorWithApis/BlazorAzureADWithApis/Client/Pages/Index.razor b/BlazorWithApis/BlazorAzureADWithApis/Client/Pages/Index.razor index 89ebf8d..02fbd81 100644 --- a/BlazorWithApis/BlazorAzureADWithApis/Client/Pages/Index.razor +++ b/BlazorWithApis/BlazorAzureADWithApis/Client/Pages/Index.razor @@ -1,3 +1,3 @@ @page "/" -

Azure AD with multiple APIs

+

Microsoft Entra ID with multiple APIs

diff --git a/BlazorWithApis/BlazorAzureADWithApis/Client/Shared/NavMenu.razor b/BlazorWithApis/BlazorAzureADWithApis/Client/Shared/NavMenu.razor index 4f8e647..ba135aa 100644 --- a/BlazorWithApis/BlazorAzureADWithApis/Client/Shared/NavMenu.razor +++ b/BlazorWithApis/BlazorAzureADWithApis/Client/Shared/NavMenu.razor @@ -1,5 +1,5 @@