Implemented authentication starte components
continuous-integration/drone/pr Build is passing

This commit is contained in:
Khwezi Mngoma
2026-05-16 15:29:43 +02:00
parent da0961fe7f
commit 5fd12b34ac
3 changed files with 240 additions and 7 deletions
+22 -6
View File
@@ -1,5 +1,6 @@
@inherits LayoutComponentBase @inherits LayoutComponentBase
@using Blazored.Toast @using Blazored.Toast
@using Microsoft.AspNetCore.Components.Authorization
<header class="top-bar"> <header class="top-bar">
<a href="/" class="brand"> <a href="/" class="brand">
@@ -19,13 +20,28 @@
<TopBarAuthstateView IsAuthenticated="false" /> <TopBarAuthstateView IsAuthenticated="false" />
</header> </header>
<NavShelf IsOpen="isShelfExpanded" IsOpenChanged="OnShelfStateChanged" @rendermode="InteractiveServer" /> <CascadingAuthenticationState>
<AuthorizeView>
<Authorized>
<NavShelf IsOpen="isShelfExpanded" IsOpenChanged="OnShelfStateChanged" @rendermode="InteractiveServer" />
</Authorized>
</AuthorizeView>
</CascadingAuthenticationState>
<div class="page-wrapper @(isShelfExpanded ? "shifted-canvas" : "")"> <CascadingAuthenticationState>
<main> <div class="page-wrapper @(isShelfExpanded ? "shifted-canvas" : "")">
@Body <AuthorizeView>
</main> <Authorized>
</div> <main class="content-body">
@Body
</main>
</Authorized>
<NotAuthorized>
<Login />
</NotAuthorized>
</AuthorizeView>
</div>
</CascadingAuthenticationState>
<BlazoredToasts /> <BlazoredToasts />
+74
View File
@@ -0,0 +1,74 @@
@page "/login"
@using Microsoft.AspNetCore.Components.Authorization
<div class="auth-workspace-canvas">
<div class="tech-background-matrix">
<svg class="bg-vector-mesh" viewBox="0 0 800 500" xmlns="http://www.w3.org/2000/svg">
<defs>
<pattern id="cyber-grid" width="40" height="40" patternUnits="userSpaceOnUse">
<path d="M 40 0 L 0 0 0 40" fill="none" stroke="#102a35" stroke-width="0.75" />
<circle cx="40" cy="40" r="1" fill="#173b4a" />
</pattern>
<filter id="core-blue-glow" x="-20%" y="-20%" width="140%" height="140%">
<feGaussianBlur stdDeviation="6" result="blur" />
<feComposite in="SourceGraphic" in2="blur" operator="over" />
</filter>
</defs>
<rect width="100%" height="100%" fill="url(#cyber-grid)" opacity="0.6" />
<g class="tech-circuit-left" stroke="#0091ff" stroke-width="1.25" fill="none" opacity="0.35">
<path d="M -50,250 L 120,250 L 180,190 L 250,190" />
<path d="M 40,100 L 100,160 L 100,340 L 160,400" />
<polyline points="220,160 240,190 220,220" />
<circle cx="250" cy="190" r="3" fill="#0091ff" />
<polygon points="30,200 60,170 90,170 60,200" stroke="#00bfff" stroke-width="1" opacity="0.5" />
<polygon points="110,300 130,280 160,280 140,300" stroke="#00bfff" stroke-width="1" opacity="0.3" />
</g>
<g class="tech-circuit-right" stroke="#00bfff" stroke-width="1.25" fill="none" opacity="0.35">
<path d="M 850,250 L 680,250 L 620,310 L 550,310" />
<path d="M 760,400 L 700,340 L 700,160 L 640,100" />
<polyline points="580,340 560,310 580,280" />
<circle cx="550" cy="310" r="3" fill="#00bfff" />
<polygon points="770,300 740,330 710,330 740,300" stroke="#0091ff" stroke-width="1" opacity="0.5" />
<polygon points="690,200 670,220 640,220 660,200" stroke="#0091ff" stroke-width="1" opacity="0.3" />
</g>
<g class="center-target" stroke="#0091ff" fill="none" opacity="0.15">
<circle cx="400" cy="250" r="90" stroke-dasharray="8 6" />
<circle cx="400" cy="250" r="130" />
<line x1="400" y1="80" x2="400" y2="420" stroke-dasharray="4 4" />
<line x1="220" y1="250" x2="580" y2="250" stroke-dasharray="4 4" />
</g>
</svg>
</div>
<div class="login-action-container">
<header class="login-header">
<span class="security-status-tag">SYSTEM_LOCKOUT_ACTIVE</span>
<h1 class="login-title">Console Authentication Required</h1>
<p class="login-subtitle">Initialize terminal authorization pipeline to access core application monitors.</p>
</header>
<button class="login-cta-button" @onclick="HandleLogin">
<span class="btn-glow-layer"></span>
<span class="btn-text-content">INITIALIZE SECURE ACCESS</span>
<svg class="btn-arrow-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5">
<line x1="5" y1="12" x2="19" y2="12"></line>
<polyline points="12 5 19 12 12 19"></polyline>
</svg>
</button>
</div>
</div>
@code {
[CascadingParameter]
private Task<AuthenticationState>? AuthState { get; set; }
private void HandleLogin()
{
// Wire up your OAuth / OpenID Connect Redirect or Auth trigger state here
}
}
+143
View File
@@ -0,0 +1,143 @@
/* Login.razor.css */
.auth-workspace-canvas {
position: relative;
display: flex;
align-items: center;
justify-content: center;
width: 100%;
height: 100%;
min-height: calc(100vh - var(--header-height, 92px));
background-color: #010405; /* Matches your core console background depth */
overflow: hidden;
box-sizing: border-box;
padding: 24px;
}
/* BOUNDLESS TECH BACKGROUND ANIMATION & MAPPING */
.tech-background-matrix {
position: absolute;
top: 50%;
left: 50%;
width: 140%;
height: 140%;
transform: translate(-50%, -50%);
pointer-events: none;
z-index: 1;
}
.bg-vector-mesh {
width: 100%;
height: 100%;
object-fit: cover;
}
/* Subtle technological pulse across background circuit networks */
.tech-circuit-left, .tech-circuit-right {
animation: background-circuit-glow 6s ease-in-out infinite alternate;
}
.tech-circuit-right {
animation-delay: 3s;
}
/* THE CONTAINER PAYLOAD */
.login-action-container {
position: relative;
z-index: 2;
display: flex;
flex-direction: column;
align-items: center;
text-align: center;
max-width: 520px;
padding: 40px;
box-sizing: border-box;
}
.login-header {
margin-bottom: 36px;
}
.security-status-tag {
font-family: monospace;
font-size: 11px;
font-weight: 700;
color: #ffd166; /* Matches your top bar warning lock indicator token */
background: rgba(255, 209, 102, 0.07);
border: 1px solid rgba(255, 209, 102, 0.25);
padding: 4px 10px;
border-radius: 2px;
letter-spacing: 1px;
text-transform: uppercase;
}
.login-title {
font-size: 26px;
font-weight: 700;
color: #ffffff;
margin: 20px 0 10px 0;
letter-spacing: -0.5px;
}
.login-subtitle {
font-size: 14px;
font-weight: 400;
color: #8fa3ad;
line-height: 1.5;
}
/* THE INVITING LARGE CALL TO ACTION BUTTON */
.login-cta-button {
position: relative;
display: inline-flex;
align-items: center;
justify-content: center;
gap: 12px;
width: 100%;
max-width: 320px;
height: 54px;
background: #0087f5; /* Core premium brand interaction blue */
color: #ffffff;
border: none;
border-radius: 4px;
font-size: 14px;
font-weight: 700;
letter-spacing: 0.5px;
cursor: pointer;
overflow: hidden;
box-shadow: 0 4px 20px rgba(0, 135, 245, 0.3);
transition: all 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.login-cta-button:hover {
background: #0091ff;
transform: translateY(-2px);
box-shadow: 0 0 24px rgba(0, 145, 255, 0.6);
}
.login-cta-button:active {
transform: translateY(0);
}
.btn-arrow-icon {
width: 16px;
height: 16px;
transition: transform 0.25s ease;
}
.login-cta-button:hover .btn-arrow-icon {
transform: translateX(4px);
}
/* KEYFRAMES */
@keyframes background-circuit-glow {
0% {
opacity: 0.25;
filter: drop-shadow(0 0 1px rgba(0, 145, 255, 0));
}
100% {
opacity: 0.55;
filter: drop-shadow(0 0 6px rgba(0, 191, 255, 0.4));
}
}