Skip to content

Commit

Permalink
#1 Convert from Microsoft.AspNetCore.Authentication.AzureADB2C.UI to …
Browse files Browse the repository at this point in the history
…Microsoft.Identity.Web.UI
  • Loading branch information
ADefWebserver committed Oct 18, 2020
1 parent 08524d2 commit 156f0a6
Show file tree
Hide file tree
Showing 4 changed files with 193 additions and 193 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@page "/AzureADB2C/Account/SignedOut"
@namespace BlazorSimpleSurvey.Pages
@namespace BlazorSimpleSurvey.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
@{
Layout = null;
Expand Down
5 changes: 3 additions & 2 deletions BlazorSimpleSurvey.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.AzureADB2C.UI" Version="3.1.9" />
<PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="3.1.9" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="3.1.9" />
<PackageReference Include="Microsoft.Graph.Auth" Version="1.0.0-preview.5" />
<PackageReference Include="Microsoft.Graph.Beta" Version="0.29.0-preview" />
<PackageReference Include="Microsoft.Identity.Web" Version="1.1.0" />
<PackageReference Include="Microsoft.Identity.Web.UI" Version="1.1.0" />
<PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="3.1.4" />
<PackageReference Include="Radzen.Blazor" Version="2.15.12" />
<PackageReference Include="Radzen.Blazor" Version="2.15.14" />
<PackageReference Include="Z.EntityFramework.Plus.EFCore" Version="3.0.67" />
</ItemGroup>

Expand Down
12 changes: 6 additions & 6 deletions Shared/LoginDisplay.razor
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
@using Microsoft.AspNetCore.Authentication.AzureADB2C.UI
@using Microsoft.Identity.Web
@using Microsoft.Extensions.Options
@inject IOptionsMonitor<AzureADB2COptions> AzureADB2COptions
@inject IOptionsMonitor<MicrosoftIdentityOptions> microsoftIdentityOptions
@inject AuthenticationStateProvider AuthenticationStateProvider

<AuthorizeView>
<Authorized>
@if (canEditProfile)
{
<a href="AzureADB2C/Account/EditProfile">Hello, @FirstName!</a>
<a href="MicrosoftIdentity/Account/EditProfile">Hello, @FirstName!</a>
}
else
{
<text>Hello, @FirstName!</text>
}
<a href="AzureADB2C/Account/SignOut">Log out</a>
<a href="MicrosoftIdentity/Account/SignOut">Log out</a>
</Authorized>
<NotAuthorized>
<a href="AzureADB2C/Account/SignIn">Log in</a>
<a href="MicrosoftIdentity/Account/SignIn">Log in</a>
</NotAuthorized>
</AuthorizeView>

Expand All @@ -26,7 +26,7 @@

protected override async Task OnInitializedAsync()
{
var options = AzureADB2COptions.Get(AzureADB2CDefaults.AuthenticationScheme);
var options = microsoftIdentityOptions.CurrentValue;
canEditProfile = !string.IsNullOrEmpty(options.EditProfilePolicyId);

var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();
Expand Down
Loading

0 comments on commit 156f0a6

Please sign in to comment.