Update identity web templates (#25834)
* Update identity web templates * Do not generate scopeRequiredByApi if not needed
This commit is contained in:
parent
4d5b3159d8
commit
472e8297a7
|
|
@ -165,7 +165,6 @@ and are generated based on the last package release.
|
||||||
<LatestPackageReference Include="MessagePack" />
|
<LatestPackageReference Include="MessagePack" />
|
||||||
<LatestPackageReference Include="MessagePackAnalyzer" />
|
<LatestPackageReference Include="MessagePackAnalyzer" />
|
||||||
<LatestPackageReference Include="Microsoft.Data.SqlClient" />
|
<LatestPackageReference Include="Microsoft.Data.SqlClient" />
|
||||||
<LatestPackageReference Include="Microsoft.Identity.Web.UI" />
|
|
||||||
<LatestPackageReference Include="Mono.Cecil" />
|
<LatestPackageReference Include="Mono.Cecil" />
|
||||||
<LatestPackageReference Include="Moq" />
|
<LatestPackageReference Include="Moq" />
|
||||||
<LatestPackageReference Include="Newtonsoft.Json.Bson" />
|
<LatestPackageReference Include="Newtonsoft.Json.Bson" />
|
||||||
|
|
|
||||||
|
|
@ -231,8 +231,9 @@
|
||||||
<IdentityServer4StoragePackageVersion>4.0.4</IdentityServer4StoragePackageVersion>
|
<IdentityServer4StoragePackageVersion>4.0.4</IdentityServer4StoragePackageVersion>
|
||||||
<IdentityServer4EntityFrameworkStoragePackageVersion>4.0.4</IdentityServer4EntityFrameworkStoragePackageVersion>
|
<IdentityServer4EntityFrameworkStoragePackageVersion>4.0.4</IdentityServer4EntityFrameworkStoragePackageVersion>
|
||||||
<MessagePackPackageVersion>2.1.90</MessagePackPackageVersion>
|
<MessagePackPackageVersion>2.1.90</MessagePackPackageVersion>
|
||||||
<MicrosoftIdentityWebPackageVersion>0.3.1-preview</MicrosoftIdentityWebPackageVersion>
|
<MicrosoftIdentityWebPackageVersion>0.4.0-preview</MicrosoftIdentityWebPackageVersion>
|
||||||
<MicrosoftIdentityWebUIPackageVersion>0.3.1-preview</MicrosoftIdentityWebUIPackageVersion>
|
<MicrosoftIdentityWebMicrosoftGraphPackageVersion>0.4.0-preview</MicrosoftIdentityWebMicrosoftGraphPackageVersion>
|
||||||
|
<MicrosoftIdentityWebUIPackageVersion>0.4.0-preview</MicrosoftIdentityWebUIPackageVersion>
|
||||||
<MessagePackAnalyzerPackageVersion>$(MessagePackPackageVersion)</MessagePackAnalyzerPackageVersion>
|
<MessagePackAnalyzerPackageVersion>$(MessagePackPackageVersion)</MessagePackAnalyzerPackageVersion>
|
||||||
<MoqPackageVersion>4.10.0</MoqPackageVersion>
|
<MoqPackageVersion>4.10.0</MoqPackageVersion>
|
||||||
<MonoCecilPackageVersion>0.11.2</MonoCecilPackageVersion>
|
<MonoCecilPackageVersion>0.11.2</MonoCecilPackageVersion>
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="${MicrosoftEntityFrameworkCoreSqlitePackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' AND '$(UseLocalDB)' != 'True'" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="${MicrosoftEntityFrameworkCoreSqlitePackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' AND '$(UseLocalDB)' != 'True'" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="${MicrosoftEntityFrameworkCoreToolsPackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' " />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="${MicrosoftEntityFrameworkCoreToolsPackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' " />
|
||||||
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
||||||
|
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="${MicrosoftIdentityWebMicrosoftGraphPackageVersion}" Condition=" '$(GenerateGraph)' == 'True' " />
|
||||||
<PackageReference Include="Microsoft.Identity.Web.UI" Version="${MicrosoftIdentityWebUIPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
<PackageReference Include="Microsoft.Identity.Web.UI" Version="${MicrosoftIdentityWebUIPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@
|
||||||
<!--#if (OrganizationalAuth || IndividualB2CAuth) -->
|
<!--#if (OrganizationalAuth || IndividualB2CAuth) -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebPackageVersion}" />
|
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebPackageVersion}" />
|
||||||
|
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="${MicrosoftIdentityWebMicrosoftGraphPackageVersion}" Condition=" '$(GenerateGraph)' == 'True' " />
|
||||||
<PackageReference Include="Microsoft.Identity.Web.UI" Version="${MicrosoftIdentityWebUIPackageVersion}" />
|
<PackageReference Include="Microsoft.Identity.Web.UI" Version="${MicrosoftIdentityWebUIPackageVersion}" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!--#endif -->
|
<!--#endif -->
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@
|
||||||
MicrosoftExtensionsHostingPackageVersion=$(MicrosoftExtensionsHostingPackageVersion);
|
MicrosoftExtensionsHostingPackageVersion=$(MicrosoftExtensionsHostingPackageVersion);
|
||||||
MicrosoftExtensionsHttpPackageVersion=$(MicrosoftExtensionsHttpPackageVersion);
|
MicrosoftExtensionsHttpPackageVersion=$(MicrosoftExtensionsHttpPackageVersion);
|
||||||
MicrosoftIdentityWebPackageVersion=$(MicrosoftIdentityWebPackageVersion);
|
MicrosoftIdentityWebPackageVersion=$(MicrosoftIdentityWebPackageVersion);
|
||||||
|
MicrosoftIdentityWebMicrosoftGraphPackageVersion=$(MicrosoftIdentityWebMicrosoftGraphPackageVersion);
|
||||||
MicrosoftIdentityWebUIPackageVersion=$(MicrosoftIdentityWebUIPackageVersion);
|
MicrosoftIdentityWebUIPackageVersion=$(MicrosoftIdentityWebUIPackageVersion);
|
||||||
MicrosoftNETCoreAppRuntimeVersion=$(MicrosoftNETCoreAppRuntimeVersion);
|
MicrosoftNETCoreAppRuntimeVersion=$(MicrosoftNETCoreAppRuntimeVersion);
|
||||||
SystemNetHttpJsonPackageVersion=$(SystemNetHttpJsonPackageVersion);
|
SystemNetHttpJsonPackageVersion=$(SystemNetHttpJsonPackageVersion);
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="${MicrosoftEntityFrameworkCoreSqlServerPackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' AND '$(UseLocalDB)' == 'True'" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="${MicrosoftEntityFrameworkCoreSqlServerPackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' AND '$(UseLocalDB)' == 'True'" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="${MicrosoftEntityFrameworkCoreToolsPackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' " />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="${MicrosoftEntityFrameworkCoreToolsPackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' " />
|
||||||
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
||||||
|
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="${MicrosoftIdentityWebMicrosoftGraphPackageVersion}" Condition=" '$(GenerateGraph)' == 'True' " />
|
||||||
<PackageReference Include="Microsoft.Identity.Web.UI" Version="${MicrosoftIdentityWebUIPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
<PackageReference Include="Microsoft.Identity.Web.UI" Version="${MicrosoftIdentityWebUIPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!--#endif -->
|
<!--#endif -->
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="${MicrosoftEntityFrameworkCoreSqlitePackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' AND '$(UseLocalDB)' != 'True'" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="${MicrosoftEntityFrameworkCoreSqlitePackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' AND '$(UseLocalDB)' != 'True'" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="${MicrosoftEntityFrameworkCoreToolsPackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' " />
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="${MicrosoftEntityFrameworkCoreToolsPackageVersion}" Condition=" '$(IndividualLocalAuth)' == 'True' " />
|
||||||
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
||||||
|
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="${MicrosoftIdentityWebMicrosoftGraphPackageVersion}" Condition=" '$(GenerateGraph)' == 'True' " />
|
||||||
<PackageReference Include="Microsoft.Identity.Web.UI" Version="${MicrosoftIdentityWebUIPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
<PackageReference Include="Microsoft.Identity.Web.UI" Version="${MicrosoftIdentityWebUIPackageVersion}" Condition=" '$(IndividualB2CAuth)' == 'True' OR '$(OrganizationalAuth)' == 'True'" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!--#endif -->
|
<!--#endif -->
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebPackageVersion}" Condition="'$(OrganizationalAuth)' == 'True' OR '$(IndividualB2CAuth)' == 'True'"/>
|
<PackageReference Include="Microsoft.Identity.Web" Version="${MicrosoftIdentityWebPackageVersion}" Condition="'$(OrganizationalAuth)' == 'True' OR '$(IndividualB2CAuth)' == 'True'"/>
|
||||||
|
<PackageReference Include="Microsoft.Identity.Web.MicrosoftGraph" Version="${MicrosoftIdentityWebMicrosoftGraphPackageVersion}" Condition=" '$(GenerateGraph)' == 'True' " />
|
||||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="${SwashbuckleAspNetCorePackageVersion}" Condition="'$(EnableOpenAPI)' == 'True'" />
|
<PackageReference Include="Swashbuckle.AspNetCore" Version="${SwashbuckleAspNetCorePackageVersion}" Condition="'$(EnableOpenAPI)' == 'True'" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<!--#endif -->
|
<!--#endif -->
|
||||||
|
|
|
||||||
|
|
@ -36,9 +36,11 @@ namespace ComponentsWebAssembly_CSharp.Server.Controllers
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly ILogger<WeatherForecastController> _logger;
|
private readonly ILogger<WeatherForecastController> _logger;
|
||||||
|
#if (OrganizationalAuth || IndividualB2CAuth)
|
||||||
|
|
||||||
// The Web API will only accept tokens 1) for users, and 2) having the "api-scope" scope for this API
|
// The Web API will only accept tokens 1) for users, and 2) having the "api-scope" scope for this API
|
||||||
static readonly string[] scopeRequiredByApi = new string[] { "api-scope" };
|
static readonly string[] scopeRequiredByApi = new string[] { "api-scope" };
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (GenerateApi)
|
#if (GenerateApi)
|
||||||
private readonly IDownstreamWebApi _downstreamWebApi;
|
private readonly IDownstreamWebApi _downstreamWebApi;
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
"replaces": "api-scope",
|
"replaces": "api-scope",
|
||||||
"defaultValue": "access_as_user",
|
"defaultValue": "access_as_user",
|
||||||
"description": "The API scope the client needs to request to provision an access token. (use with IndividualB2C, SingleOrg)."
|
"description": "The API scope the client needs to request to provision an access token. (use with IndividualB2C, SingleOrg)."
|
||||||
},
|
},
|
||||||
"TenantId": {
|
"TenantId": {
|
||||||
"type": "parameter",
|
"type": "parameter",
|
||||||
"datatype": "string",
|
"datatype": "string",
|
||||||
|
|
|
||||||
|
|
@ -35,9 +35,11 @@ namespace Company.WebApplication1.Controllers
|
||||||
};
|
};
|
||||||
|
|
||||||
private readonly ILogger<WeatherForecastController> _logger;
|
private readonly ILogger<WeatherForecastController> _logger;
|
||||||
|
#if (OrganizationalAuth || IndividualB2CAuth)
|
||||||
|
|
||||||
// The Web API will only accept tokens 1) for users, and 2) having the "api-scope" scope for this API
|
// The Web API will only accept tokens 1) for users, and 2) having the "api-scope" scope for this API
|
||||||
static readonly string[] scopeRequiredByApi = new string[] { "api-scope" };
|
static readonly string[] scopeRequiredByApi = new string[] { "api-scope" };
|
||||||
|
#endif
|
||||||
|
|
||||||
#if (GenerateApi)
|
#if (GenerateApi)
|
||||||
private readonly IDownstreamWebApi _downstreamWebApi;
|
private readonly IDownstreamWebApi _downstreamWebApi;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue