Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions UltimateAuth.slnx
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,20 @@
<Project Path="docs/website/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm/CodeBeam.UltimateAuth.Docs.Wasm.csproj" Id="629c8d74-d253-4ef2-9f26-47a405d9d7a6" />
</Folder>
<Folder Name="/Packages/">
<Project Path="nuget/CodeBeam.UltimateAuth.EntityFrameworkCore/CodeBeam.UltimateAuth.EntityFrameworkCore.Bundle.csproj" Id="764569b4-dd5b-4a18-a332-7307d20ee21a" />
<Project Path="nuget/CodeBeam.UltimateAuth.InMemory/CodeBeam.UltimateAuth.InMemory.Bundle.csproj" />
<Project Path="nuget/CodeBeam.UltimateAuth.Reference.Bundle/CodeBeam.UltimateAuth.Reference.Bundle.csproj" Id="f01dee6a-a60d-40a2-bb6a-9894b03e7122" />
<Project Path="src/bundle/CodeBeam.UltimateAuth.EntityFrameworkCore.Bundle/CodeBeam.UltimateAuth.EntityFrameworkCore.Bundle.csproj" Id="764569b4-dd5b-4a18-a332-7307d20ee21a" />
<Project Path="src/bundle/CodeBeam.UltimateAuth.InMemory.Bundle/CodeBeam.UltimateAuth.InMemory.Bundle.csproj" />
<Project Path="src/bundle/CodeBeam.UltimateAuth.Reference.Bundle/CodeBeam.UltimateAuth.Reference.Bundle.csproj" Id="f01dee6a-a60d-40a2-bb6a-9894b03e7122" />
</Folder>
<Folder Name="/Samples/">
<Project Path="samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore/CodeBeam.UltimateAuth.Sample.BlazorServer.EFCore.csproj" Id="84201d45-0298-4bf3-9bd4-0567b373f6a0" />
<Project Path="samples/blazor-server/CodeBeam.UltimateAuth.Sample.BlazorServer/CodeBeam.UltimateAuth.Sample.BlazorServer.csproj" />
<Project Path="samples/blazor-standalone-wasm/CodeBeam.UltimateAuth.Sample.BlazorStandaloneWasm/CodeBeam.UltimateAuth.Sample.BlazorStandaloneWasm.csproj" Id="27bd3c4d-65a9-4c70-a6c9-4178b1897730" />
<Project Path="samples/CodeBeam.UltimateAuth.Sample.Seed/CodeBeam.UltimateAuth.Sample.Seed.csproj" Id="c79b227b-409e-439d-97df-8979a3dc1a60" />
<Project Path="samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.Client/CodeBeam.UAuth.Sample.IntWasm.Client.csproj" Id="f17355ac-c53c-44e8-b372-a258493bf950" />
<Project Path="samples/int-wasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm/CodeBeam.UAuth.Sample.IntWasm.csproj" Id="65386675-4cf7-4745-b4d7-544b6404e0c3" />
<Project Path="samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore/CodeBeam.UltimateAuth.Sample.ResourceApi.EfCore.csproj" Id="ac247836-455a-4a71-9a52-73587c2393f3" />
<Project Path="samples/resource-api/CodeBeam.UltimateAuth.Sample.ResourceApi/CodeBeam.UltimateAuth.Sample.ResourceApi.csproj" Id="3d877c9b-65eb-45be-b259-431b2d386736" />
<Project Path="samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub.EFCore/CodeBeam.UltimateAuth.Sample.UAuthHub.EFCore.csproj" Id="a1fc0019-8a7c-4452-8e8c-4c2bdd549de0" />
<Project Path="samples/UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub/CodeBeam.UltimateAuth.Sample.UAuthHub.csproj" Id="ae5368ee-10aa-4c75-9653-a7f481849834" />
</Folder>
<Folder Name="/Solution Items/">
Expand All @@ -35,6 +39,7 @@
<Project Path="src/authorization/CodeBeam.UltimateAuth.Authorization.InMemory/CodeBeam.UltimateAuth.Authorization.InMemory.csproj" Id="a1e6d007-bdc0-4574-b549-ec863757edd3" />
<Project Path="src/authorization/CodeBeam.UltimateAuth.Authorization.Reference/CodeBeam.UltimateAuth.Authorization.Reference.csproj" Id="84b784d0-bb48-406a-a0d1-c600da667597" />
<Project Path="src/authorization/CodeBeam.UltimateAuth.Authorization/CodeBeam.UltimateAuth.Authorization.csproj" Id="28b1d647-fb0b-4cc3-8503-2680c4a9b28f" />
<Project Path="src/client/CodeBeam.UltimateAuth.Client.AspNetCore/CodeBeam.UltimateAuth.Client.AspNetCore.csproj" Id="aa4e9064-759f-4756-b1ee-d84c73826105" />
<Project Path="src/client/CodeBeam.UltimateAuth.Client.Blazor/CodeBeam.UltimateAuth.Client.Blazor.csproj" Id="eb60a3b7-ba9d-48c9-98ad-b28e879b23bf" />
<Project Path="src/client/CodeBeam.UltimateAuth.Client/CodeBeam.UltimateAuth.Client.csproj" Id="fa128a9b-613c-4762-993a-2886280d3051" />
<Project Path="src/CodeBeam.UltimateAuth.Core/CodeBeam.UltimateAuth.Core.csproj" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="9.0.3" />
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="9.0.4" />
<PackageReference Include="CodeBeam.MudBlazor.Extensions.Code" Version="9.0.1" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="10.0.5" />
<PackageReference Include="MudBlazor" Version="9.2.0" />
<PackageReference Include="MudBlazor" Version="9.3.0" />
</ItemGroup>

<Target Name="BuildDocs" BeforeTargets="Build">
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\nuget\CodeBeam.UltimateAuth.Reference.Bundle\CodeBeam.UltimateAuth.Reference.Bundle.csproj" />
<ProjectReference Include="..\..\src\bundle\CodeBeam.UltimateAuth.Reference.Bundle\CodeBeam.UltimateAuth.Reference.Bundle.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
@namespace CodeBeam.UltimateAuth.Sample
@inherits ComponentBase

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 200 240" width="@Size" height="@Size" style="@BuildStyle()" class="@Class">

@if (Variant == UAuthLogoVariant.Brand)
{
<path fill="@ShieldColor"
d="M32.39,14.07H167.61c11.27,0,18,6.76,18,18V133.52c0,22.54-58.59,69.87-85.64,92.41-27-22.54-85.64-69.87-85.64-92.41V32.1C14.36,20.83,21.12,14.07,32.39,14.07Z" />

<path fill="@KeyColor" fill-rule="evenodd" d="@KeyPath" />
}
else
{
<path d="M32.39,14.07H167.61c11.27,0,18,6.76,18,18V133.52c0,22.54-58.59,69.87-85.64,92.41-27-22.54-85.64-69.87-85.64-92.41V32.1C14.36,20.83,21.12,14.07,32.39,14.07Z" />

<path fill-rule="evenodd" d="@KeyPath" />
}
</svg>
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Web;

namespace CodeBeam.UltimateAuth.Sample;

public partial class UAuthLogo : ComponentBase
{
[Parameter] public UAuthLogoVariant Variant { get; set; } = UAuthLogoVariant.Brand;

[Parameter] public int Size { get; set; } = 32;

[Parameter] public string? ShieldColor { get; set; } = "#00072d";
[Parameter] public string? KeyColor { get; set; } = "#f6f5ae";

[Parameter] public string? Class { get; set; }
[Parameter] public string? Style { get; set; }

private string BuildStyle()
{
if (Variant == UAuthLogoVariant.Mono)
return $"color: {KeyColor}; {Style}";

return Style ?? "";
}

protected string KeyPath => @"
M120.43,39.44H79.57A11.67,11.67,0,0,0,67.9,51.11V77.37
A11.67,11.67,0,0,0,79.57,89H90.51l3.89,3.9v5.32l-3.8,3.81v81.41H99
v-5.33h13.69V169H108.1v-3.8H99C99,150.76,111.9,153,111.9,153
V99.79h-8V93.32L108.19,89h12.24
A11.67,11.67,0,0,0,132.1,77.37V51.11
A11.67,11.67,0,0,0,120.43,39.44Z

M79.57,48.19h5.84a2.92,2.92 0 0 1 2.92,2.92
v5.84a2.92,2.92 0 0 1 -2.92,2.92
h-5.84a2.91,2.91 0 0 1 -2.91,-2.92
v-5.84a2.91,2.91 0 0 1 2.91,-2.92Z

M79.57,68.62h5.84a2.92,2.92 0 0 1 2.92,2.92
v5.83a2.92,2.92 0 0 1 -2.92,2.92
h-5.84a2.91,2.91 0 0 1 -2.91,-2.92
v-5.83a2.91,2.91 0 0 1 2.91,-2.92Z

M114.59,48.19h5.84a2.92,2.92 0 0 1 2.91,2.92
v5.84a2.91,2.91 0 0 1 -2.91,2.91
h-5.84a2.92,2.92 0 0 1 -2.92,-2.91
v-5.84a2.92,2.92 0 0 1 2.92,-2.92Z

M114.59,68.62h5.84a2.92,2.92 0 0 1 2.91,2.92
v5.83a2.91,2.91 0 0 1 -2.91,2.92
h-5.84a2.92,2.92 0 0 1 -2.92,-2.92
v-5.83a2.92,2.92 0 0 1 2.92,-2.92Z
";
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
namespace CodeBeam.UltimateAuth.Sample;

public enum UAuthLogoVariant
{
Brand,
Mono
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<IsPackable>false</IsPackable>
<BlazorDisableThrowNavigationException>true</BlazorDisableThrowNavigationException>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CodeBeam.MudBlazor.Extensions" Version="9.0.4" />
<PackageReference Include="Microsoft.AspNetCore.OpenApi" Version="10.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="10.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="10.0.5" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="10.0.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="MudBlazor" Version="9.3.0" />
<PackageReference Include="Scalar.AspNetCore" Version="2.13.22" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\src\bundle\CodeBeam.UltimateAuth.EntityFrameworkCore.Bundle\CodeBeam.UltimateAuth.EntityFrameworkCore.Bundle.csproj" />
<ProjectReference Include="..\..\..\src\client\CodeBeam.UltimateAuth.Client.Blazor\CodeBeam.UltimateAuth.Client.Blazor.csproj" />
<ProjectReference Include="..\..\..\src\CodeBeam.UltimateAuth.Server\CodeBeam.UltimateAuth.Server.csproj" />
<ProjectReference Include="..\..\CodeBeam.UltimateAuth.Sample.Seed\CodeBeam.UltimateAuth.Sample.Seed.csproj" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="/" />
<ResourcePreloader />
<link rel="stylesheet" href="@Assets["lib/bootstrap/dist/css/bootstrap.min.css"]" />
<link rel="stylesheet" href="@Assets["app.css"]" />
<link rel="stylesheet" href="@Assets["CodeBeam.UltimateAuth.Sample.UAuthHub.EFCore.styles.css"]" />
<ImportMap />
<link rel="icon" type="image/png" href="UltimateAuth-Logo.png" />
<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
<link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
<link href="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.css" rel="stylesheet" />
<HeadOutlet @rendermode="InteractiveServer" />
</head>

<body>
<Routes @rendermode="InteractiveServer" />
<ReconnectModal />
<script src="@Assets["_framework/blazor.web.js"]"></script>
<script src="_content/MudBlazor/MudBlazor.min.js"></script>
<script src="_content/CodeBeam.MudBlazor.Extensions/MudExtensions.min.js"></script>
<script src="_content/CodeBeam.UltimateAuth.Client.Blazor/uauth.min.js"></script>
</body>

</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
@inherits UAuthHubLayoutComponentBase
@inject IUAuthClient UAuthClient
@inject ISnackbar Snackbar
@inject NavigationManager Nav

@if (!IsHubAuthorized)
{
<MudAppBar Class="uauth-blur" Color="Color.Transparent" Dense="true" Elevation="0">
<UAuthLogo />
<MudText Class="ml-2 cursor-pointer" Style="user-select: none" @onclick="@(() => Nav.NavigateTo("/home", true))"><b>UltimateAuth</b></MudText>
<MudDivider Class="ml-3 mr-1" Vertical="true" />
<MudText Class="ml-2" Style="line-height: 14px" Typo="Typo.subtitle2">UAuthHub Sample</MudText>

<MudSpacer />

<MudIconButton Icon="@(DarkModeManager.IsDarkMode? Icons.Material.Filled.LightMode : Icons.Material.Filled.DarkMode)" OnClick="@(() => DarkModeManager.ToggleAsync())" />
</MudAppBar>

<MudPage Class="d-flex align-center justify-center" FullScreen="FullScreen.FullWithoutAppbar" Column="1" Row="1">
<MudPaper Class="pa-8" Elevation="4" Style="max-width: 520px; width: 100%;">
<MudStack Spacing="3" AlignItems="AlignItems.Center">
<UAuthLogo Size="72" />

<MudText Typo="Typo.h5"><b>Access Denied</b></MudText>

<MudText Typo="Typo.body2" Align="Align.Center">
This page cannot be accessed directly.
UAuthHub login flows can only be initiated by an authorized client application.
</MudText>

<MudDivider Class="my-2" />

<MudText Typo="Typo.caption" Color="Color.Secondary">
UltimateAuth protects this resource based on your session and permissions.
</MudText>
</MudStack>
</MudPaper>
</MudPage>
return;
}

<MudLayout>
<MudAppBar Class="uauth-blur" Color="Color.Transparent" Dense="true" Elevation="0">
<UAuthLogo />
<MudText Class="ml-2 cursor-pointer" Style="user-select: none" @onclick="@(() => Nav.NavigateTo("/home", true))"><b>UltimateAuth</b></MudText>
<MudDivider Class="ml-3 mr-1" Vertical="true" />
<MudText Class="ml-2" Style="line-height: 14px" Typo="Typo.subtitle2">UAuthHub Sample</MudText>

<MudSpacer />

<MudIconButton Icon="@(DarkModeManager.IsDarkMode? Icons.Material.Filled.LightMode : Icons.Material.Filled.DarkMode)" OnClick="@(() => DarkModeManager.ToggleAsync())" />

<UAuthStateView>
<Authorized Context="state">
<MudMenu PopoverClass="mud-theme-primary uauth-menu-popover" AnchorOrigin="Origin.BottomRight" TransformOrigin="Origin.TopRight">
<ActivatorContent>
<div @onclick="@(() => context.ToggleAsync())">
<MudBadge Overlap="true" Dot="true" Color="@GetBadgeColor()">
<MudAvatar Class="cursor-pointer mud-ripple" Variant="Variant.Filled" Color="Color.Primary">
<MudText Typo="Typo.subtitle2">@((state.Identity?.DisplayName ?? "?").Trim() is var n ? (n.Length >= 2 ? n[..2] : n[..1]) : "?")</MudText>
</MudAvatar>
</MudBadge>
</div>
</ActivatorContent>

<ChildContent>
<MudText Class="px-4 py-2"><b>@state.Identity?.DisplayName</b></MudText>
<MudText Class="px-4" Typo="Typo.subtitle2">@string.Join(", ", state.Claims.Roles)</MudText>

<MudDivider />

<MudMenuItem Icon="@Icons.Material.Filled.Refresh" IconColor="Color.Secondary" Label="Refresh Session" OnClick="@Refresh" />
<MudMenuItem Icon="@Icons.Material.Filled.VerifiedUser" IconColor="Color.Secondary" Label="Validate Session" OnClick="@Validate" />
<MudMenuItem Icon="@Icons.Material.Filled.Logout" IconColor="Color.Secondary" Label="Logout" OnClick="@Logout" />

@if (state.Identity?.SessionState is not null && state.Identity.SessionState != SessionState.Active)
{
<MudDivider />
<MudMenuItem Icon="@Icons.Material.Filled.Login" Label="Reauthenticate" OnClick="@GoToLoginWithReturn" />
}
</ChildContent>
</MudMenu>
</Authorized>

<NotAuthorized>
<MudChip T="string" Style="width: fit-content" Text="Sign In" Color="Color.Primary" Variant="Variant.Filled" Class="cursor-pointer" OnClick="@HandleSignInClick" />
</NotAuthorized>
</UAuthStateView>
</MudAppBar>

<MudMainContent>
@Body
</MudMainContent>
</MudLayout>


<div id="blazor-error-ui">
An unhandled error has occurred.
<a href="" class="reload">Reload</a>
<a class="dismiss">🗙</a>
</div>
Loading
Loading