Skip to content

Commit

Permalink
Remove cases in templates as (#375)
Browse files Browse the repository at this point in the history
- (bug in Blazor templates) B2C apps don't call Microsoft Graph
- B2C Web APIs (that is webapi2 and blazowasm -hosted with B2C) don't call downstream APIs since OBO is not supported in B2C

- Updating Blazor web assembly hosted client to .NET 5.0 preview 7 (requires RuntimeIdentitier)
- Removing the cases where B2C would do an OBO in test-templates.bat
  • Loading branch information
jmprieur authored Jul 29, 2020
1 parent f6c3110 commit 3c77e3c
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@
},
"GenerateGraph": {
"type": "computed",
"value": "((IndividualB2CAuth || OrganizationalAuth) && CallsMicrosoftGraph)"
"value": "(OrganizationalAuth && CallsMicrosoftGraph)"
},
"GenerateApiOrGraph": {
"type": "computed",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,11 +487,11 @@
},
"GenerateApi": {
"type": "computed",
"value": "((IndividualB2CAuth || OrganizationalAuth) && (CalledApiUrl != \"https://graph.microsoft.com/v1.0/me\" || CalledApiScopes != \"user.read\"))"
"value": "( ((IndividualB2CAuth && !Hosted) || OrganizationalAuth) && (CalledApiUrl != \"https://graph.microsoft.com/v1.0/me\" || CalledApiScopes != \"user.read\"))"
},
"GenerateGraph": {
"type": "computed",
"value": "((IndividualB2CAuth || OrganizationalAuth) && CallsMicrosoftGraph)"
"value": "(OrganizationalAuth && CallsMicrosoftGraph)"
},
"GenerateApiOrGraph": {
"type": "computed",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFrameworks>netcoreapp3.1;net5.0</TargetFrameworks>
<UseBlazorWebAssembly>true</UseBlazorWebAssembly>
<RuntimeIdentifier>browser-wasm</RuntimeIdentifier>
<UseBlazorWebAssembly>true</UseBlazorWebAssembly>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netcoreapp3.1' ">
Expand All @@ -16,14 +17,14 @@
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net5.0' ">
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0-preview.6.20312.15" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.0-preview.6.20312.15" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="5.0.0-preview.6.20312.15" />
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="5.0.0-preview.6.20312.15" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0-*" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="5.0.0-*" PrivateAssets="all" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.Authentication" Version="5.0.0-*" />
<PackageReference Include="Microsoft.Authentication.WebAssembly.Msal" Version="5.0.0-*" />
<!--#if (Hosted) -->
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0-preview.6.20305.6" />
<PackageReference Include="Microsoft.Extensions.Http" Version="5.0.0-*" />
<!--#endif -->
<PackageReference Include="System.Net.Http.Json" Version="5.0.0-preview.6.20305.6" />
<PackageReference Include="System.Net.Http.Json" Version="5.0.0-*" />
</ItemGroup>

<!--#if (Hosted) -->
Expand Down
16 changes: 0 additions & 16 deletions ProjectTemplates/test-templates.bat
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ dotnet new webapi2 --auth IndividualB2C
dotnet sln ..\..\tests.sln add webapi2-b2c.csproj
cd ..

echo "Test webapi2, b2c, calling a downstream web api"
mkdir webapi2-b2c-callswebapi
cd webapi2-b2c-callswebapi
dotnet new webapi2 --auth IndividualB2C --called-api-url "https://localhost:44332/api/todolist" --called-api-scopes "https://fabrikamb2c.onmicrosoft.com/tasks/read"
dotnet sln ..\..\tests.sln add webapi2-b2c-callswebapi.csproj
cd ..

cd ..

REM MVC Web app
Expand Down Expand Up @@ -271,15 +264,6 @@ dotnet sln ..\..\tests.sln add Server\blazorwasm2-b2c-hosted.Server.csproj
dotnet sln ..\..\tests.sln add Client\blazorwasm2-b2c-hosted.Client.csproj
cd ..

echo "Test blazorwasm2, b2c, with hosted blazor web server web api, calling a downstream web api"
mkdir blazorwasm2-b2c-callswebapi-hosted
cd blazorwasm2-b2c-callswebapi-hosted
dotnet new blazorwasm2 --auth IndividualB2C --called-api-url "https://localhost:44332/api/todolist" --called-api-scopes "https://fabrikamb2c.onmicrosoft.com/tasks/read" --hosted
dotnet sln ..\..\tests.sln add Shared\blazorwasm2-b2c-callswebapi-hosted.Shared.csproj
dotnet sln ..\..\tests.sln add Server\blazorwasm2-b2c-callswebapi-hosted.Server.csproj
dotnet sln ..\..\tests.sln add Client\blazorwasm2-b2c-callswebapi-hosted.Client.csproj
cd ..

cd ..

echo "Build the solution with all the projects created by applying the templates"
Expand Down

0 comments on commit 3c77e3c

Please sign in to comment.