From 080d112958b99839cb2bb72acd351739f9fa427c Mon Sep 17 00:00:00 2001 From: Jean-Marc Prieur Date: Tue, 1 Sep 2020 21:37:17 +0200 Subject: [PATCH 1/6] Fix for https://github.com/AzureAD/microsoft-identity-web/issues/506 Separate Microsoft Graph support from Microsoft.Identity.web Needs more work on templates. --- Microsoft.Identity.Web.sln | 12 +++ .../Constants.cs | 18 +++++ .../IDWebErrorMessage.cs | 13 +++ ...crosoft.Identity.Web.MicrosoftGraph.csproj | 71 +++++++++++++++++ .../MicrosoftGraphExtensions.cs | 0 .../MicrosoftGraphOptions.cs | 0 .../TokenAcquisitionCredentialProvider.cs | 0 ...oft.Identity.Web.MicrosoftGraphBeta.csproj | 79 +++++++++++++++++++ .../DownstreamWebApiOptions.cs | 2 +- .../Microsoft.Identity.Web.csproj | 1 - .../Microsoft.Identity.Web.xml | 63 +-------------- tests/BlazorServerCallsGraph/blazor.csproj | 1 + .../Microsoft.Identity.Web.Test.csproj | 1 + .../WebAppCallsMicrosoftGraph.csproj | 1 + .../TodoListService/TodoListService.csproj | 1 + 15 files changed, 199 insertions(+), 64 deletions(-) create mode 100644 src/Microsoft.Identity.Web.MicrosoftGraph/Constants.cs create mode 100644 src/Microsoft.Identity.Web.MicrosoftGraph/IDWebErrorMessage.cs create mode 100644 src/Microsoft.Identity.Web.MicrosoftGraph/Microsoft.Identity.Web.MicrosoftGraph.csproj rename src/{Microsoft.Identity.Web/MicrosoftGraph => Microsoft.Identity.Web.MicrosoftGraph}/MicrosoftGraphExtensions.cs (100%) rename src/{Microsoft.Identity.Web/MicrosoftGraph => Microsoft.Identity.Web.MicrosoftGraph}/MicrosoftGraphOptions.cs (100%) rename src/{Microsoft.Identity.Web/MicrosoftGraph => Microsoft.Identity.Web.MicrosoftGraph}/TokenAcquisitionCredentialProvider.cs (100%) create mode 100644 src/Microsoft.Identity.Web.MicrosoftGraphBeta/Microsoft.Identity.Web.MicrosoftGraphBeta.csproj diff --git a/Microsoft.Identity.Web.sln b/Microsoft.Identity.Web.sln index 17dd4af1c..c6208899d 100644 --- a/Microsoft.Identity.Web.sln +++ b/Microsoft.Identity.Web.sln @@ -77,6 +77,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "blazorwasm2-b2c-hosted.Clie EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "blazorwasm2-b2c-hosted.Server", "tests\blazorwasm2-b2c-hosted\Server\blazorwasm2-b2c-hosted.Server.csproj", "{69ECC686-3077-4E46-97F6-D287A4821FD4}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Web.MicrosoftGraph", "src\Microsoft.Identity.Web.MicrosoftGraph\Microsoft.Identity.Web.MicrosoftGraph.csproj", "{9A736AA6-54DD-47E0-85D9-3CFEE2CDD92A}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.Identity.Web.MicrosoftGraphBeta", "src\Microsoft.Identity.Web.MicrosoftGraphBeta\Microsoft.Identity.Web.MicrosoftGraphBeta.csproj", "{B68226EF-2A43-4040-A583-061F25A4DE21}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -167,6 +171,14 @@ Global {69ECC686-3077-4E46-97F6-D287A4821FD4}.Debug|Any CPU.Build.0 = Debug|Any CPU {69ECC686-3077-4E46-97F6-D287A4821FD4}.Release|Any CPU.ActiveCfg = Release|Any CPU {69ECC686-3077-4E46-97F6-D287A4821FD4}.Release|Any CPU.Build.0 = Release|Any CPU + {9A736AA6-54DD-47E0-85D9-3CFEE2CDD92A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9A736AA6-54DD-47E0-85D9-3CFEE2CDD92A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9A736AA6-54DD-47E0-85D9-3CFEE2CDD92A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9A736AA6-54DD-47E0-85D9-3CFEE2CDD92A}.Release|Any CPU.Build.0 = Release|Any CPU + {B68226EF-2A43-4040-A583-061F25A4DE21}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B68226EF-2A43-4040-A583-061F25A4DE21}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B68226EF-2A43-4040-A583-061F25A4DE21}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B68226EF-2A43-4040-A583-061F25A4DE21}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/src/Microsoft.Identity.Web.MicrosoftGraph/Constants.cs b/src/Microsoft.Identity.Web.MicrosoftGraph/Constants.cs new file mode 100644 index 000000000..b20f454ca --- /dev/null +++ b/src/Microsoft.Identity.Web.MicrosoftGraph/Constants.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Identity.Web +{ + /// + /// General constants. + /// + internal static class Constants + { + public const string Authorization = "Authorization"; + public const string Bearer = "Bearer"; + + // Microsoft Graph + public const string UserReadScope = "user.read"; + public const string GraphBaseUrlV1 = "https://graph.microsoft.com/v1.0"; + } +} diff --git a/src/Microsoft.Identity.Web.MicrosoftGraph/IDWebErrorMessage.cs b/src/Microsoft.Identity.Web.MicrosoftGraph/IDWebErrorMessage.cs new file mode 100644 index 000000000..29c6329db --- /dev/null +++ b/src/Microsoft.Identity.Web.MicrosoftGraph/IDWebErrorMessage.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +namespace Microsoft.Identity.Web +{ + /// + /// Constants related to the error messages. + /// + internal static class IDWebErrorMessage + { + public const string CalledApiScopesAreNull = "IDW10207: The CalledApiScopes cannot be null. "; + } +} diff --git a/src/Microsoft.Identity.Web.MicrosoftGraph/Microsoft.Identity.Web.MicrosoftGraph.csproj b/src/Microsoft.Identity.Web.MicrosoftGraph/Microsoft.Identity.Web.MicrosoftGraph.csproj new file mode 100644 index 000000000..b5a3b6ce7 --- /dev/null +++ b/src/Microsoft.Identity.Web.MicrosoftGraph/Microsoft.Identity.Web.MicrosoftGraph.csproj @@ -0,0 +1,71 @@ + + + + + 0.4.0-localbuild + + $(ClientSemVer) + + $(DefineConstants);WEB + true + + Microsoft Identity Web, Microsoft Graph helper + Microsoft + Microsoft Corporation + Microsoft Identity Web + + This package enables ASP.NET Core Web apps and Web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). + This package is specifically used for web applications, which sign-in users, and protected web APIs, call Microsoft Graph. + + © Microsoft Corporation. All rights reserved. + MIT + https://github.com/AzureAD/microsoft-identity-web + https://github.com/AzureAD/microsoft-identity-web + The release notes are available at https://github.com/AzureAD/microsoft-identity-web/releases and the roadmap at https://github.com/AzureAD/microsoft-identity-web/wiki#roadmap + Microsoft Identity Web;Microsoft identity platform;Microsoft.Identity.Web;.NET;ASP.NET Core;Web App;Web API;B2C;Azure Active Directory;AAD;Identity;Authentication;Authorization + + + true + true + + true + snupkg + + + + + + + + + True + + + + + + + + + + + + + + + + + + netcoreapp3.1; net5.0 + true + ../../build/MSAL.snk + true + enable + + + + + false + + + diff --git a/src/Microsoft.Identity.Web/MicrosoftGraph/MicrosoftGraphExtensions.cs b/src/Microsoft.Identity.Web.MicrosoftGraph/MicrosoftGraphExtensions.cs similarity index 100% rename from src/Microsoft.Identity.Web/MicrosoftGraph/MicrosoftGraphExtensions.cs rename to src/Microsoft.Identity.Web.MicrosoftGraph/MicrosoftGraphExtensions.cs diff --git a/src/Microsoft.Identity.Web/MicrosoftGraph/MicrosoftGraphOptions.cs b/src/Microsoft.Identity.Web.MicrosoftGraph/MicrosoftGraphOptions.cs similarity index 100% rename from src/Microsoft.Identity.Web/MicrosoftGraph/MicrosoftGraphOptions.cs rename to src/Microsoft.Identity.Web.MicrosoftGraph/MicrosoftGraphOptions.cs diff --git a/src/Microsoft.Identity.Web/MicrosoftGraph/TokenAcquisitionCredentialProvider.cs b/src/Microsoft.Identity.Web.MicrosoftGraph/TokenAcquisitionCredentialProvider.cs similarity index 100% rename from src/Microsoft.Identity.Web/MicrosoftGraph/TokenAcquisitionCredentialProvider.cs rename to src/Microsoft.Identity.Web.MicrosoftGraph/TokenAcquisitionCredentialProvider.cs diff --git a/src/Microsoft.Identity.Web.MicrosoftGraphBeta/Microsoft.Identity.Web.MicrosoftGraphBeta.csproj b/src/Microsoft.Identity.Web.MicrosoftGraphBeta/Microsoft.Identity.Web.MicrosoftGraphBeta.csproj new file mode 100644 index 000000000..442505df8 --- /dev/null +++ b/src/Microsoft.Identity.Web.MicrosoftGraphBeta/Microsoft.Identity.Web.MicrosoftGraphBeta.csproj @@ -0,0 +1,79 @@ + + + + + 0.4.0-localbuild + + $(ClientSemVer) + + $(DefineConstants);WEB + true + + Microsoft Identity Web, Microsoft Graph helper + Microsoft + Microsoft Corporation + Microsoft Identity Web + + This package enables ASP.NET Core Web apps and Web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). + This package is specifically used for web applications, which sign-in users, and protected web APIs, call Microsoft Graph Beta API. + + © Microsoft Corporation. All rights reserved. + MIT + https://github.com/AzureAD/microsoft-identity-web + https://github.com/AzureAD/microsoft-identity-web + The release notes are available at https://github.com/AzureAD/microsoft-identity-web/releases and the roadmap at https://github.com/AzureAD/microsoft-identity-web/wiki#roadmap + Microsoft Identity Web;Microsoft identity platform;Microsoft.Identity.Web;.NET;ASP.NET Core;Web App;Web API;B2C;Azure Active Directory;AAD;Identity;Authentication;Authorization + + + true + true + + true + snupkg + + + + + + + + + + + + + + + + + True + + + + + + + + + + + + + + + + + + netcoreapp3.1; net5.0 + true + ../../build/MSAL.snk + true + enable + + + + + false + + + diff --git a/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApiOptions.cs b/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApiOptions.cs index c040c0777..dec4da9d7 100644 --- a/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApiOptions.cs +++ b/src/Microsoft.Identity.Web/DownstreamWebApiSupport/DownstreamWebApiOptions.cs @@ -7,7 +7,7 @@ namespace Microsoft.Identity.Web { /// /// Options passed-in to call downstream web APIs. To call Microsoft Graph, see rather - /// . + /// MicrosoftGraphOptions" in the Microsoft.Identity.Web.MicrosoftGraph assembly. /// public class DownstreamWebApiOptions { diff --git a/src/Microsoft.Identity.Web/Microsoft.Identity.Web.csproj b/src/Microsoft.Identity.Web/Microsoft.Identity.Web.csproj index 216f460e6..d2851fa23 100644 --- a/src/Microsoft.Identity.Web/Microsoft.Identity.Web.csproj +++ b/src/Microsoft.Identity.Web/Microsoft.Identity.Web.csproj @@ -94,7 +94,6 @@ all runtime; build; native; contentfiles; analyzers; buildtransitive - all diff --git a/src/Microsoft.Identity.Web/Microsoft.Identity.Web.xml b/src/Microsoft.Identity.Web/Microsoft.Identity.Web.xml index 0b11bfad0..142fc5699 100644 --- a/src/Microsoft.Identity.Web/Microsoft.Identity.Web.xml +++ b/src/Microsoft.Identity.Web/Microsoft.Identity.Web.xml @@ -588,7 +588,7 @@ Options passed-in to call downstream web APIs. To call Microsoft Graph, see rather - . + MicrosoftGraphOptions" in the Microsoft.Identity.Web.MicrosoftGraph assembly. @@ -927,67 +927,6 @@ OpenID Connect event. A that represents a completed remove from cache operation. - - - Extensions methods on a MicrosoftIdentityAppCallingWebApiAuthenticationBuilder builder - to add support to call Microsoft Graph. - - - - - Add support to call Microsoft Graph. From a named option and a configuration section. - - Builder. - Configuration section. - The builder to chain. - - - - Add support to call Microsoft Graph. From a base Graph URL and a default scope. - - Builder. - Named instance of option. - Configuration section. - The builder to chain. - - - - Add support to call Microsoft Graph. From a named options and a configuration method. - - Builder. - Method to configure the options. - The builder to chain. - - - - Options passed-in to call Microsoft Graph. - - - - - Base URL for the Microsoft Graph API. By default: "https://graph.microsoft.com/v1.0/" - but it can be changed to use the Microsoft Graph Beta endpoint or national cloud versions - of MicrosoftGraph. - - - - - Space separated scopes used to call Microsoft Graph, - for instance user.read mail.read. - - - - - Authentication provider based on ITokenAcquisition. - - - - - Adds a bearer header to an HttpRequestMessage. - - HttpRequest message to authenticate. - A Task (as this is an async method). - Base class for Web app and Web API Microsoft Identity authentication diff --git a/tests/BlazorServerCallsGraph/blazor.csproj b/tests/BlazorServerCallsGraph/blazor.csproj index 6f39697f6..fbf018d78 100644 --- a/tests/BlazorServerCallsGraph/blazor.csproj +++ b/tests/BlazorServerCallsGraph/blazor.csproj @@ -4,6 +4,7 @@ 66e5c3c7-f757-4032-bfcf-68bd81948618 + diff --git a/tests/Microsoft.Identity.Web.Test/Microsoft.Identity.Web.Test.csproj b/tests/Microsoft.Identity.Web.Test/Microsoft.Identity.Web.Test.csproj index 94c11bab8..5707719e1 100644 --- a/tests/Microsoft.Identity.Web.Test/Microsoft.Identity.Web.Test.csproj +++ b/tests/Microsoft.Identity.Web.Test/Microsoft.Identity.Web.Test.csproj @@ -38,6 +38,7 @@ + diff --git a/tests/WebAppCallsMicrosoftGraph/WebAppCallsMicrosoftGraph.csproj b/tests/WebAppCallsMicrosoftGraph/WebAppCallsMicrosoftGraph.csproj index 7cad3f275..2a3d90149 100644 --- a/tests/WebAppCallsMicrosoftGraph/WebAppCallsMicrosoftGraph.csproj +++ b/tests/WebAppCallsMicrosoftGraph/WebAppCallsMicrosoftGraph.csproj @@ -4,6 +4,7 @@ aspnet-WebApp_OpenIDConnect_DotNet-81EA87AD-E64D-4755-A1CC-5EA47F49B5D8 + diff --git a/tests/WebAppCallsWebApiCallsGraph/TodoListService/TodoListService.csproj b/tests/WebAppCallsWebApiCallsGraph/TodoListService/TodoListService.csproj index fb0389417..50014080b 100644 --- a/tests/WebAppCallsWebApiCallsGraph/TodoListService/TodoListService.csproj +++ b/tests/WebAppCallsWebApiCallsGraph/TodoListService/TodoListService.csproj @@ -7,6 +7,7 @@ + From 52b65a94bd4a942267c41465181ae6da4cc606ea Mon Sep 17 00:00:00 2001 From: Jean-Marc Prieur Date: Tue, 1 Sep 2020 23:06:37 +0200 Subject: [PATCH 2/6] Udapting the templates --- .../AspNetCoreMicrosoftIdentityWebProjectTemplates.csproj | 2 +- .../BlazorServerWeb-CSharp/BlazorServerWeb-CSharp.csproj | 7 +++++-- .../Server/ComponentsWebAssembly-CSharp.Server.csproj | 5 ++++- .../RazorPagesWeb-CSharp/Company.WebApplication1.csproj | 7 +++++-- .../StarterWeb-CSharp/Company.WebApplication1.csproj | 7 +++++-- .../templates/WebApi-CSharp/Company.WebApplication1.csproj | 5 ++++- ProjectTemplates/test-templates.bat | 2 +- .../Microsoft.Identity.Web.UI.csproj | 2 +- src/Microsoft.Identity.Web/Microsoft.Identity.Web.csproj | 2 +- 9 files changed, 27 insertions(+), 12 deletions(-) diff --git a/ProjectTemplates/AspNetCoreMicrosoftIdentityWebProjectTemplates.csproj b/ProjectTemplates/AspNetCoreMicrosoftIdentityWebProjectTemplates.csproj index 071d781c8..014f5e74c 100644 --- a/ProjectTemplates/AspNetCoreMicrosoftIdentityWebProjectTemplates.csproj +++ b/ProjectTemplates/AspNetCoreMicrosoftIdentityWebProjectTemplates.csproj @@ -2,7 +2,7 @@ - 0.3.0-preview + 0.4.0-preview $(ClientSemVer) diff --git a/ProjectTemplates/templates/BlazorServerWeb-CSharp/BlazorServerWeb-CSharp.csproj b/ProjectTemplates/templates/BlazorServerWeb-CSharp/BlazorServerWeb-CSharp.csproj index 11dd908c9..a0ec5975a 100644 --- a/ProjectTemplates/templates/BlazorServerWeb-CSharp/BlazorServerWeb-CSharp.csproj +++ b/ProjectTemplates/templates/BlazorServerWeb-CSharp/BlazorServerWeb-CSharp.csproj @@ -3,7 +3,10 @@ netcoreapp3.1; net5.0 - - + + + + + diff --git a/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Server/ComponentsWebAssembly-CSharp.Server.csproj b/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Server/ComponentsWebAssembly-CSharp.Server.csproj index d4ba06223..2c55020d7 100644 --- a/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Server/ComponentsWebAssembly-CSharp.Server.csproj +++ b/ProjectTemplates/templates/ComponentsWebAssembly-CSharp/Server/ComponentsWebAssembly-CSharp.Server.csproj @@ -4,7 +4,10 @@ - + + + + diff --git a/ProjectTemplates/templates/RazorPagesWeb-CSharp/Company.WebApplication1.csproj b/ProjectTemplates/templates/RazorPagesWeb-CSharp/Company.WebApplication1.csproj index 11dd908c9..a0ec5975a 100644 --- a/ProjectTemplates/templates/RazorPagesWeb-CSharp/Company.WebApplication1.csproj +++ b/ProjectTemplates/templates/RazorPagesWeb-CSharp/Company.WebApplication1.csproj @@ -3,7 +3,10 @@ netcoreapp3.1; net5.0 - - + + + + + diff --git a/ProjectTemplates/templates/StarterWeb-CSharp/Company.WebApplication1.csproj b/ProjectTemplates/templates/StarterWeb-CSharp/Company.WebApplication1.csproj index 11dd908c9..a0ec5975a 100644 --- a/ProjectTemplates/templates/StarterWeb-CSharp/Company.WebApplication1.csproj +++ b/ProjectTemplates/templates/StarterWeb-CSharp/Company.WebApplication1.csproj @@ -3,7 +3,10 @@ netcoreapp3.1; net5.0 - - + + + + + diff --git a/ProjectTemplates/templates/WebApi-CSharp/Company.WebApplication1.csproj b/ProjectTemplates/templates/WebApi-CSharp/Company.WebApplication1.csproj index 33c84e4fb..146a5ee06 100644 --- a/ProjectTemplates/templates/WebApi-CSharp/Company.WebApplication1.csproj +++ b/ProjectTemplates/templates/WebApi-CSharp/Company.WebApplication1.csproj @@ -3,7 +3,10 @@ netcoreapp3.1; net5.0 - + + + + diff --git a/ProjectTemplates/test-templates.bat b/ProjectTemplates/test-templates.bat index a17edfb9e..91062b577 100644 --- a/ProjectTemplates/test-templates.bat +++ b/ProjectTemplates/test-templates.bat @@ -2,7 +2,7 @@ echo "Build and Install templates" dotnet pack AspNetCoreMicrosoftIdentityWebProjectTemplates.csproj cd bin cd Debug -dotnet new -i Microsoft.Identity.Web.ProjectTemplates.0.3.0-preview.nupkg +dotnet new -i Microsoft.Identity.Web.ProjectTemplates.0.4.0-preview.nupkg echo "Test templates" mkdir tests diff --git a/src/Microsoft.Identity.Web.UI/Microsoft.Identity.Web.UI.csproj b/src/Microsoft.Identity.Web.UI/Microsoft.Identity.Web.UI.csproj index 6b436a436..1b6be27bf 100644 --- a/src/Microsoft.Identity.Web.UI/Microsoft.Identity.Web.UI.csproj +++ b/src/Microsoft.Identity.Web.UI/Microsoft.Identity.Web.UI.csproj @@ -2,7 +2,7 @@ - 0.2.0-localbuild + 0.4.0-localbuild $(ClientSemVer) diff --git a/src/Microsoft.Identity.Web/Microsoft.Identity.Web.csproj b/src/Microsoft.Identity.Web/Microsoft.Identity.Web.csproj index d2851fa23..9a8457727 100644 --- a/src/Microsoft.Identity.Web/Microsoft.Identity.Web.csproj +++ b/src/Microsoft.Identity.Web/Microsoft.Identity.Web.csproj @@ -2,7 +2,7 @@ - 0.2.0-localbuild + 0.4.0-localbuild $(ClientSemVer) From d0975ff581fc5f49ba0c9268f14bd61f7a09a18d Mon Sep 17 00:00:00 2001 From: Jean-Marc Prieur Date: Wed, 2 Sep 2020 18:52:11 +0200 Subject: [PATCH 3/6] Addressing PR comments --- .../Constants.cs | 18 ------------------ .../IDWebErrorMessage.cs | 13 ------------- ...icrosoft.Identity.Web.MicrosoftGraph.csproj | 5 +++-- ...soft.Identity.Web.MicrosoftGraphBeta.csproj | 7 +++---- .../Properties/InternalsVisibleTo.cs | 4 +++- 5 files changed, 9 insertions(+), 38 deletions(-) delete mode 100644 src/Microsoft.Identity.Web.MicrosoftGraph/Constants.cs delete mode 100644 src/Microsoft.Identity.Web.MicrosoftGraph/IDWebErrorMessage.cs diff --git a/src/Microsoft.Identity.Web.MicrosoftGraph/Constants.cs b/src/Microsoft.Identity.Web.MicrosoftGraph/Constants.cs deleted file mode 100644 index b20f454ca..000000000 --- a/src/Microsoft.Identity.Web.MicrosoftGraph/Constants.cs +++ /dev/null @@ -1,18 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Microsoft.Identity.Web -{ - /// - /// General constants. - /// - internal static class Constants - { - public const string Authorization = "Authorization"; - public const string Bearer = "Bearer"; - - // Microsoft Graph - public const string UserReadScope = "user.read"; - public const string GraphBaseUrlV1 = "https://graph.microsoft.com/v1.0"; - } -} diff --git a/src/Microsoft.Identity.Web.MicrosoftGraph/IDWebErrorMessage.cs b/src/Microsoft.Identity.Web.MicrosoftGraph/IDWebErrorMessage.cs deleted file mode 100644 index 29c6329db..000000000 --- a/src/Microsoft.Identity.Web.MicrosoftGraph/IDWebErrorMessage.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. - -namespace Microsoft.Identity.Web -{ - /// - /// Constants related to the error messages. - /// - internal static class IDWebErrorMessage - { - public const string CalledApiScopesAreNull = "IDW10207: The CalledApiScopes cannot be null. "; - } -} diff --git a/src/Microsoft.Identity.Web.MicrosoftGraph/Microsoft.Identity.Web.MicrosoftGraph.csproj b/src/Microsoft.Identity.Web.MicrosoftGraph/Microsoft.Identity.Web.MicrosoftGraph.csproj index b5a3b6ce7..e13be3061 100644 --- a/src/Microsoft.Identity.Web.MicrosoftGraph/Microsoft.Identity.Web.MicrosoftGraph.csproj +++ b/src/Microsoft.Identity.Web.MicrosoftGraph/Microsoft.Identity.Web.MicrosoftGraph.csproj @@ -14,8 +14,9 @@ Microsoft Corporation Microsoft Identity Web - This package enables ASP.NET Core Web apps and Web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). - This package is specifically used for web applications, which sign-in users, and protected web APIs, call Microsoft Graph. + This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). + This package is specifically used for web applications, which sign-in users and call Microsoft Graph, and for protected web APIs + that call Microsoft Graph. © Microsoft Corporation. All rights reserved. MIT diff --git a/src/Microsoft.Identity.Web.MicrosoftGraphBeta/Microsoft.Identity.Web.MicrosoftGraphBeta.csproj b/src/Microsoft.Identity.Web.MicrosoftGraphBeta/Microsoft.Identity.Web.MicrosoftGraphBeta.csproj index 442505df8..5c4e07111 100644 --- a/src/Microsoft.Identity.Web.MicrosoftGraphBeta/Microsoft.Identity.Web.MicrosoftGraphBeta.csproj +++ b/src/Microsoft.Identity.Web.MicrosoftGraphBeta/Microsoft.Identity.Web.MicrosoftGraphBeta.csproj @@ -14,8 +14,9 @@ Microsoft Corporation Microsoft Identity Web - This package enables ASP.NET Core Web apps and Web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). - This package is specifically used for web applications, which sign-in users, and protected web APIs, call Microsoft Graph Beta API. + This package enables ASP.NET Core web apps and web APIs to use the Microsoft identity platform (formerly Azure AD v2.0). + This package is specifically used for web applications, which sign-in users and call Microsoft Graph Beta, and for protected web APIs + that call Microsoft Graph Beta. © Microsoft Corporation. All rights reserved. MIT @@ -37,8 +38,6 @@ - - diff --git a/src/Microsoft.Identity.Web/Properties/InternalsVisibleTo.cs b/src/Microsoft.Identity.Web/Properties/InternalsVisibleTo.cs index 1a28ea04f..664a2e4a4 100644 --- a/src/Microsoft.Identity.Web/Properties/InternalsVisibleTo.cs +++ b/src/Microsoft.Identity.Web/Properties/InternalsVisibleTo.cs @@ -4,7 +4,9 @@ using System.Runtime.CompilerServices; // Allow this assembly to be serviced when run on desktop CLR +[assembly: InternalsVisibleTo("Microsoft.Identity.Web.MicrosoftGraph, PublicKey=00240000048000009400000006020000002400005253413100040000010001002D96616729B54F6D013D71559A017F50AA4861487226C523959D1579B93F3FDF71C08B980FD3130062B03D3DE115C4B84E7AC46AEF5E192A40E7457D5F3A08F66CEAB71143807F2C3CB0DA5E23B38F0559769978406F6E5D30CEADD7985FC73A5A609A8B74A1DF0A29399074A003A226C943D480FEC96DBEC7106A87896539AD")] +[assembly: InternalsVisibleTo("Microsoft.Identity.Web.MicrosoftGraphBeta, PublicKey=00240000048000009400000006020000002400005253413100040000010001002D96616729B54F6D013D71559A017F50AA4861487226C523959D1579B93F3FDF71C08B980FD3130062B03D3DE115C4B84E7AC46AEF5E192A40E7457D5F3A08F66CEAB71143807F2C3CB0DA5E23B38F0559769978406F6E5D30CEADD7985FC73A5A609A8B74A1DF0A29399074A003A226C943D480FEC96DBEC7106A87896539AD")] [assembly: InternalsVisibleTo("Microsoft.Identity.Web.Test, PublicKey=00240000048000009400000006020000002400005253413100040000010001002D96616729B54F6D013D71559A017F50AA4861487226C523959D1579B93F3FDF71C08B980FD3130062B03D3DE115C4B84E7AC46AEF5E192A40E7457D5F3A08F66CEAB71143807F2C3CB0DA5E23B38F0559769978406F6E5D30CEADD7985FC73A5A609A8B74A1DF0A29399074A003A226C943D480FEC96DBEC7106A87896539AD")] [assembly: InternalsVisibleTo("Microsoft.Identity.Web.Test.Common, PublicKey=00240000048000009400000006020000002400005253413100040000010001002D96616729B54F6D013D71559A017F50AA4861487226C523959D1579B93F3FDF71C08B980FD3130062B03D3DE115C4B84E7AC46AEF5E192A40E7457D5F3A08F66CEAB71143807F2C3CB0DA5E23B38F0559769978406F6E5D30CEADD7985FC73A5A609A8B74A1DF0A29399074A003A226C943D480FEC96DBEC7106A87896539AD")] [assembly: InternalsVisibleTo("Microsoft.Identity.Web.Test.Integration, PublicKey=00240000048000009400000006020000002400005253413100040000010001002D96616729B54F6D013D71559A017F50AA4861487226C523959D1579B93F3FDF71C08B980FD3130062B03D3DE115C4B84E7AC46AEF5E192A40E7457D5F3A08F66CEAB71143807F2C3CB0DA5E23B38F0559769978406F6E5D30CEADD7985FC73A5A609A8B74A1DF0A29399074A003A226C943D480FEC96DBEC7106A87896539AD")] -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] \ No newline at end of file +[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=0024000004800000940000000602000000240000525341310004000001000100c547cac37abd99c8db225ef2f6c8a3602f3b3606cc9891605d02baa56104f4cfc0734aa39b93bf7852f7d9266654753cc297e7d2edfe0bac1cdcf9f717241550e0a7b191195b7667bb4f64bcb8e2121380fd1d9d46ad2d92d2d15605093924cceaf74c4861eff62abf69b9291ed0a340e113be11e6a7d3113e92484cf7045cc7")] From c859f46f3a10c90ad3a97617f92f9ab53ad9f538 Mon Sep 17 00:00:00 2001 From: Jean-Marc Prieur Date: Wed, 2 Sep 2020 20:01:56 +0200 Subject: [PATCH 4/6] Improving the Nuget.config to test the templates --- ProjectTemplates/nuget.config | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ProjectTemplates/nuget.config b/ProjectTemplates/nuget.config index ef29eb040..c86300669 100644 --- a/ProjectTemplates/nuget.config +++ b/ProjectTemplates/nuget.config @@ -17,6 +17,11 @@ --> + + + + + - - - + + + - + + +