diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/HomeController.cs b/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/HomeController.cs index e7d1de63..6fb96dd2 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/HomeController.cs +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/HomeController.cs @@ -1,7 +1,7 @@ /* The MIT License (MIT) -Copyright (c) 2018 Microsoft Corporation +Copyright (c) 2020 Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -79,7 +79,13 @@ public IActionResult UnauthorizedTenant() { return View(); } + + public IActionResult Privacy() + { + return View(); + } + [AllowAnonymous] [ResponseCache(Duration = 0, Location = ResponseCacheLocation.None, NoStore = true)] public IActionResult Error() { diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/OnboardingController.cs b/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/OnboardingController.cs index a6b429f6..59c12f98 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/OnboardingController.cs +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/OnboardingController.cs @@ -1,7 +1,7 @@ /* The MIT License (MIT) -Copyright (c) 2018 Microsoft Corporation +Copyright (c) 2020 Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/TodoListController.cs b/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/TodoListController.cs index 21ddcb27..0ac5f7f6 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/TodoListController.cs +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Controllers/TodoListController.cs @@ -1,7 +1,7 @@ /* The MIT License (MIT) -Copyright (c) 2018 Microsoft Corporation +Copyright (c) 2020 Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Models/AuthorizedTenant.cs b/2-WebApp-graph-user/2-3-Multi-Tenant/Models/AuthorizedTenant.cs index 5aed5cf5..411b80aa 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Models/AuthorizedTenant.cs +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Models/AuthorizedTenant.cs @@ -1,7 +1,7 @@ /* The MIT License (MIT) -Copyright (c) 2018 Microsoft Corporation +Copyright (c) 2020 Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Program.cs b/2-WebApp-graph-user/2-3-Multi-Tenant/Program.cs index 35f911c9..6d677f0d 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Program.cs +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Program.cs @@ -1,7 +1,7 @@ /* The MIT License (MIT) -Copyright (c) 2018 Microsoft Corporation +Copyright (c) 2020 Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Services/IMSGraphService.cs b/2-WebApp-graph-user/2-3-Multi-Tenant/Services/IMSGraphService.cs index 94e73613..5c4fd021 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Services/IMSGraphService.cs +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Services/IMSGraphService.cs @@ -1,7 +1,7 @@ /* The MIT License (MIT) -Copyright (c) 2018 Microsoft Corporation +Copyright (c) 2020 Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Services/ITodoItemService.cs b/2-WebApp-graph-user/2-3-Multi-Tenant/Services/ITodoItemService.cs index 28d45e41..cc3ef0ec 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Services/ITodoItemService.cs +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Services/ITodoItemService.cs @@ -1,7 +1,7 @@ /* The MIT License (MIT) -Copyright (c) 2018 Microsoft Corporation +Copyright (c) 2020 Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Services/MSGraphService.cs b/2-WebApp-graph-user/2-3-Multi-Tenant/Services/MSGraphService.cs index f1115d0d..baf7cbbf 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Services/MSGraphService.cs +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Services/MSGraphService.cs @@ -1,7 +1,7 @@ /* The MIT License (MIT) -Copyright (c) 2018 Microsoft Corporation +Copyright (c) 2020 Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Services/TodoItemService.cs b/2-WebApp-graph-user/2-3-Multi-Tenant/Services/TodoItemService.cs index 5f8f9f7e..164fec7e 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Services/TodoItemService.cs +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Services/TodoItemService.cs @@ -1,7 +1,7 @@ /* The MIT License (MIT) -Copyright (c) 2018 Microsoft Corporation +Copyright (c) 2020 Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -113,8 +113,8 @@ public async Task Delete(int id, ClaimsPrincipal user) sampleDbContext.TodoItems.Remove(todoItem); await sampleDbContext.SaveChangesAsync(); } - } - + } + private bool IsAuthorizedToModify(int itemId, ClaimsPrincipal user) { var tenantId = user.GetTenantId(); diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Startup.cs b/2-WebApp-graph-user/2-3-Multi-Tenant/Startup.cs index 8f27e088..f0c06519 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Startup.cs +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Startup.cs @@ -86,10 +86,10 @@ public void ConfigureServices(IServiceCollection services) }; }) .EnableTokenAcquisitionToCallDownstreamApi( - options => - { - Configuration.Bind("AzureAd", options); - }, + options => + { + Configuration.Bind("AzureAd", options); + }, new string[] { GraphScope.UserReadAll }) .AddInMemoryTokenCaches(); diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Utils/UnauthorizedTenantException.cs b/2-WebApp-graph-user/2-3-Multi-Tenant/Utils/UnauthorizedTenantException.cs index d9c268ca..b8ed91d5 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Utils/UnauthorizedTenantException.cs +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Utils/UnauthorizedTenantException.cs @@ -1,7 +1,7 @@ /* The MIT License (MIT) -Copyright (c) 2018 Microsoft Corporation +Copyright (c) 2020 Microsoft Corporation Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -28,7 +28,7 @@ namespace WebApp_OpenIDConnect_DotNet.Utils { public class UnauthorizedTenantException : UnauthorizedAccessException { - public UnauthorizedTenantException():base() { } - public UnauthorizedTenantException(string message):base(message) { } + public UnauthorizedTenantException() : base() { } + public UnauthorizedTenantException(string message) : base(message) { } } } diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Views/Home/Privacy.cshtml b/2-WebApp-graph-user/2-3-Multi-Tenant/Views/Home/Privacy.cshtml index 7bd38619..a850e762 100644 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Views/Home/Privacy.cshtml +++ b/2-WebApp-graph-user/2-3-Multi-Tenant/Views/Home/Privacy.cshtml @@ -1,6 +1,6 @@ -@{ - ViewData["Title"] = "Privacy Policy"; -} -
Use this page to detail your site's privacy policy.
+@{ + ViewData["Title"] = "Privacy Policy"; +} +Use this page to detail your site's privacy policy.
diff --git a/2-WebApp-graph-user/2-3-Multi-Tenant/Views/Shared/_CookieConsentPartial.cshtml b/2-WebApp-graph-user/2-3-Multi-Tenant/Views/Shared/_CookieConsentPartial.cshtml deleted file mode 100644 index 6db1d32c..00000000 --- a/2-WebApp-graph-user/2-3-Multi-Tenant/Views/Shared/_CookieConsentPartial.cshtml +++ /dev/null @@ -1,40 +0,0 @@ -@using Microsoft.AspNetCore.Http.Features -@{ - var consentFeature = Context.Features.Get