Security & Auth Patterns
A production web app is only as good as its security. This course covers the patterns that keep Wisej.NET applications safe — from session and identity handling to roles, OAuth and the hardening you do before going live. You'll work through authentication and session identity, role- and claim-based authorization, integrating OAuth providers, and a practical checklist of server-side hardening for real deployments. This course is in production — enrol now to be notified the moment it goes live.
Sessions, roles, OAuth and hardening strategies for production Wisej apps.
- Level: Advanced
- Duration: 6.6h
- Modules: 7
This course is not open yet. The planned outline is below.
Curriculum
Module 1: The Wisej.NET Security Model
Module 1 of Security & Auth Patterns — the Wisej.NET security track. Read the lesson guide and the lab / exam guide, watch the AccessOps attack surface walkthrough, pass the knowledge check, then complete the hands-on lab in AccessOps.
- ReadingLesson Guide · 14 min
What the browser can and cannot see in a server-side UI, the session boundary, the threat model, and where each control lives. What this means for a developer securing a production Wisej.NET app — and how to read this module.
- ReadingLab / Exam Guide · 10 min
What you'll build in the hands-on lab, the suggested approach, and the required deliverables.
- Video lessonMap the AccessOps attack surface · 14 min
Map the AccessOps attack surface — a guided Module 1 walkthrough, built step by step in AccessOps. Runs right here in the player.
Narration transcript
Start by identifying what AccessOps must protect and where requests enter. Employees, documents, and approvals cross different boundaries, so a login screen alone cannot define the security model.
Keep sensitive values out of control properties even when a control is hidden. Server-side business logic stays on the server, but interface state can be transmitted to the browser.
Draw the boundaries between browser, session, process, and data services. A value safe inside one session can become exposed when a static field shares it across users.
Review each entry point against the threat categories and rate the consequences. The table connects a possible attack to the place where a defensive control must operate.
Project employee records to the fields the directory actually needs. Hiding a salary column does not remove its transmitted value; protected pay data needs its own checked retrieval.
Treat button visibility as presentation only. The approval service must obtain the caller from the session, check permission, and record denial independently of what the screen displayed.
Inspect the transmitted data alongside the visible grid. Extra salary and review fields demonstrate why a reassuring screenshot cannot prove that confidential values stayed on the server.
Observe the coordinator invoking approval despite the hidden control. The unchanged request and recorded denial show that the service boundary, rather than the interface, enforces the rule.
Build the shell and document assets, entry points, threats, and control placement. These deliverables explain which boundary each later security feature is intended to protect.
- ReadingAI Coding Exercise · 20 min
Build this module's AccessOps sample with ChatGPT or Claude from a ready-made prompt that points the model at this module's specification, then review, run and extend what it gives you.
- Knowledge checkModule 1 Knowledge Check · 10 min · Pass mark 80%
- Hands-on labLab — AccessOps Threat Model · 45 min
Objective: Create the AccessOps solution and write its threat model: draw the trust boundaries, list the assets (employee records, documents, approvals), enumerate the entry points (login, uploads, downloads, custom endpoints, the AI assistant), rate each threat, and map every mitigation to the module of this course that implements it. Build the shell with a placeholder login page. Deliverables: AccessOps solution with a placeholder login page; Trust boundary diagram; Asset and entry point inventory; Threat table with likelihood, impact and mitigation; Security control placement map.
Module 2: Authentication and Session Identity
Module 2 of Security & Auth Patterns — the Wisej.NET security track. Read the lesson guide and the lab / exam guide, watch the Authentication & Session Identity walkthrough, pass the knowledge check, then complete the hands-on lab in AccessOps.
- ReadingLesson Guide · 14 min
Login flows, password handling, a SessionContext with a verified identity, timeouts, logout, remember-me and session fixation. What this means for a developer securing a production Wisej.NET app — and how to read this module.
- ReadingLab / Exam Guide · 10 min
What you'll build in the hands-on lab, the suggested approach, and the required deliverables.
- Video lessonBuild the AccessOps login and session identity · 14 min
Build the AccessOps login and session identity — a guided Module 2 walkthrough, built step by step in AccessOps. Runs right here in the player.
Narration transcript
Establish a verified session identity before protecting AccessOps records and approvals. Every later permission decision depends on knowing who the server has authenticated, rather than trusting a value from the screen.
Do not derive identity from a hidden control, window flag, department selection, or shared current-user field. Those values are either client-controlled or have the wrong lifetime for session authentication.
Follow the password verification rather than looking for decryption. The example derives a value using the stored salt and iteration count, then compares it without an early character-by-character exit.
Replace the anonymous session after successful verification so its old identifier does not survive login. Warn before inactivity expires the authenticated session, then release its associated state.
Compare the rejected login code with PasswordService.Verify. The stored salt and work factor support verification, while one outward failure message avoids disclosing which part of the credentials was wrong.
Keep throttling, verification, and auditing on the same sign-in path. Unknown users still incur verification work, and a single sign-out routine provides one consistent way to end authenticated state.
Watch repeated failures produce the same user message before lockout. The audit distinguishes outcomes internally; timing also needs attention because wording alone cannot prevent an observable difference.
Follow the idle warning through session exit. Loaded documents and windows belong to that lifetime, and returning through browser history must lead to login rather than renewed access.
Implement login and logout as complete lifecycles, including lockout, verification, auditing, and timeout. Create the session identity only after verification, then test how every failure and exit behaves.
- ReadingAI Coding Exercise · 20 min
Build this module's AccessOps sample with ChatGPT or Claude from a ready-made prompt that points the model at this module's specification, then review, run and extend what it gives you.
- Knowledge checkModule 2 Knowledge Check · 10 min · Pass mark 80%
- Hands-on labLab — Login and Session Identity · 45 min
Objective: Implement AccessOps authentication: a login page with lockout after five failures, password verification with a modern salted hash, a SessionContext created only after verification and stored in the session, an idle timeout that returns the user to login and clears state, an explicit Logout that ends the session, and an audit record for every login attempt. Deliverables: Login page with lockout and generic error messages; Password hashing and verification service; SessionContext with verified identity; Idle timeout and explicit logout; Login audit records.
Module 3: Authorization: Roles, Claims and Permissions
Module 3 of Security & Auth Patterns — the Wisej.NET security track. Read the lesson guide and the lab / exam guide, watch the service-level authorization walkthrough, pass the knowledge check, then complete the hands-on lab in AccessOps.
- ReadingLesson Guide · 14 min
Role-based and claim-based checks, permission services, enforcing rules in services and repositories, and adapting the UI to what the user may do. What this means for a developer securing a production Wisej.NET app — and how to read this module.
- ReadingLab / Exam Guide · 10 min
What you'll build in the hands-on lab, the suggested approach, and the required deliverables.
- Video lessonEnforce permissions in services, reflect them in the UI · 14 min
Enforce permissions in services, reflect them in the UI — a guided Module 3 walkthrough, built step by step in AccessOps. Runs right here in the player.
Narration transcript
Now separate knowing the caller from allowing the action. An authenticated AccessOps session still needs a rule deciding whether that employee may approve the particular request.
Protect the business operation itself, including department and manager scope. A check confined to a button can be bypassed by another caller, including a background job.
Resolve roles and claims into session permissions at login. Keep the precedence rule explicit: a denial wins over a grant, so conflicting inputs do not silently broaden access.
Place the guard at the start of the approval method. Buttons, tasks, jobs, and callbacks must all pass it because the operation has one authorization boundary regardless of its caller.
Compare visibility-based code with server-resolved permissions. An immutable permission set and its resolution time describe the server's decision; the button can reflect that decision but cannot establish it.
After checking the permission, restrict the query to requests this manager may approve. Operation permission and record scope answer different questions, and both must be enforced before data is returned.
Compare Dana and Miriam's screens to see permissions reflected in navigation and commands. The manager's approval option also depends on the request's relationship to her own reports.
Call the service directly with a forged identifier to test the actual boundary. A denial, server record, and unchanged request demonstrate protection even when the interface is skipped.
Guard document and approval operations and scope their data queries. Submit a negative test alongside the adapted interface to prove the server refuses an unauthorized request.
- ReadingAI Coding Exercise · 20 min
Build this module's AccessOps sample with ChatGPT or Claude from a ready-made prompt that points the model at this module's specification, then review, run and extend what it gives you.
- Knowledge checkModule 3 Knowledge Check · 10 min · Pass mark 80%
- Hands-on labLab — Service-Level Authorization · 45 min
Objective: Add authorization to AccessOps: a PermissionService resolving roles and claims into permissions at login, an Authorize guard called by every DocumentService and ApprovalService method, a record-level rule that employees see only their department and managers only their reports, a UI that hides admin actions and disables approve buttons the user cannot use, and a test proving a forged request from a non-manager is rejected by the service. Deliverables: PermissionService resolving permissions into the SessionContext; Authorization guard in every service method; Department and manager record-level rules; Permission-aware UI adaptation; Negative test with a forged request.
Module 4: OAuth and OpenID Connect Integration
Module 4 of Security & Auth Patterns — the Wisej.NET security track. Read the lesson guide and the lab / exam guide, watch the external sign-in walkthrough, pass the knowledge check, then complete the hands-on lab in AccessOps.
- ReadingLesson Guide · 14 min
Delegating login to an identity provider, the authorization code flow, redirect handling in a Wisej.NET app, token validation and mapping claims to the SessionContext. What this means for a developer securing a production Wisej.NET app — and how to read this module.
- ReadingLab / Exam Guide · 10 min
What you'll build in the hands-on lab, the suggested approach, and the required deliverables.
- Video lessonSign in to AccessOps with an external identity provider · 14 min
Sign in to AccessOps with an external identity provider — a guided Module 4 walkthrough, built step by step in AccessOps. Runs right here in the player.
Narration transcript
Replace local password verification with identity from the corporate provider. The browser carries the sign-in journey, but AccessOps must validate the return before creating a trusted session.
Delegation centralizes account lifecycle and sign-in policy. It also introduces an incoming identity message that the application must treat as untrusted until validation completes.
Follow redirect, one-time code, and server exchange separately. State, nonce, and the proof-key challenge connect the return to the sign-in attempt that actually began it.
Keep verifier, nonce, and destination on the server behind a short-lived handle. Matching and consuming that record prevents the browser from defining this sign-in state.
Decoding an identity token only reveals its contents. Validate signature, issuer, audience, lifetime, and nonce before using claims; readable content is not proof of a valid identity.
Map validated issuer and subject to an employee. Newly provisioned accounts start without rights because application permissions are resolved locally rather than granted automatically with an identity.
Trace exchange, validation, mapping, and session creation together. Test rejected cases as carefully as success, because accepting an invalid return is what this boundary must prevent.
Distinguish application and provider sessions during sign-out. Ending only the Wisej.NET session can permit silent sign-in again; the provider's end-session flow handles its separate lifetime.
Build the OpenID Connect client with proof key for code exchange and validation. Include provisioning, the specified service-account fallback, and sign-out addressing both session owners.
- ReadingAI Coding Exercise · 20 min
Build this module's AccessOps sample with ChatGPT or Claude from a ready-made prompt that points the model at this module's specification, then review, run and extend what it gives you.
- Knowledge checkModule 4 Knowledge Check · 10 min · Pass mark 80%
- Hands-on labLab — External Sign-In with OIDC · 45 min
Objective: Add external sign-in to AccessOps: an OpenID Connect client using the authorization code flow with PKCE against a test identity provider, a callback handler that validates the ID token and its nonce, a claim mapping that fills the SessionContext and provisions a local employee record on first login, a fallback to local login for service accounts, and sign-out that ends both the local and the provider session. Deliverables: OIDC client configuration with PKCE; Callback handling with token and nonce validation; Claim mapping and first-login provisioning; Local login fallback for service accounts; Sign-out covering both sessions.
Module 5: Protecting Data, Uploads, Downloads and Handlers
Module 5 of Security & Auth Patterns — the Wisej.NET security track. Read the lesson guide and the lab / exam guide, watch the confidential documents walkthrough, pass the knowledge check, then complete the hands-on lab in AccessOps.
- ReadingLesson Guide · 14 min
Authorizing file uploads and downloads, safe custom HTTP handlers, input validation, output encoding, injection and cross-site risks in a server-side UI. What this means for a developer securing a production Wisej.NET app — and how to read this module.
- ReadingLab / Exam Guide · 10 min
What you'll build in the hands-on lab, the suggested approach, and the required deliverables.
- Video lessonSecure the confidential documents feature · 14 min
Secure the confidential documents feature — a guided Module 5 walkthrough, built step by step in AccessOps. Runs right here in the player.
Narration transcript
Inspect the actual bytes crossing AccessOps boundaries. A verified login does not automatically protect uploads, generated links, or files served outside the application's authorization path.
Identify static files, trusted uploads, independent handlers, and interpreted user text. Each bypass crosses a different boundary and therefore needs an explicit check there.
Distinguish a static address from an authorized document operation. Protected retrieval must pass identification, permission, and audit checks in the service before the application sends the file.
Check upload size, allowed extension, and content signature before accepting storage. A server-chosen name and quarantine separate incoming files from scanned documents ready for release.
Treat the document identifier as a request to authorize, not a filesystem path. The service must establish read permission before opening bytes, regardless of the grid's value.
Authenticate share-link contents and expiry before serving the document. Distrust incoming values likewise in database commands, interpreted labels, and browser calls rather than relying on their origin.
Follow the renamed executable through validation. An extension check is insufficient: the signature rejects it, while the genuine document follows quarantine and scanning before storage.
Test forged downloads and altered links from another department. Consistent refusal demonstrates independent checks on each request rather than trust in hidden buttons or screen navigation.
Complete upload gates, authorized downloads, and expiring signed links, then test forgery. Review queries and displayed strings too: files are only one route for untrusted values.
- ReadingAI Coding Exercise · 20 min
Build this module's AccessOps sample with ChatGPT or Claude from a ready-made prompt that points the model at this module's specification, then review, run and extend what it gives you.
- Knowledge checkModule 5 Knowledge Check · 10 min · Pass mark 80%
- Hands-on labLab — Secure Documents Feature · 45 min
Objective: Secure the AccessOps documents feature: uploads limited by size and type with content sniffing, stored outside the web root with a random name and linked to the owning department, downloads that go through DocumentService authorization and Application.Download, a custom handler for a signed share link that expires in one hour, and a review that every query is parameterised and every user-provided string is encoded before display. Deliverables: Validated upload pipeline with quarantine folder; Authorized download through the service; Signed, expiring share-link handler; Parameterised query and output encoding review; Test with a forged download request.
Module 6: Auditing, Secrets and Configuration
Module 6 of Security & Auth Patterns — the Wisej.NET security track. Read the lesson guide and the lab / exam guide, watch the audit trail & secrets walkthrough, pass the knowledge check, then complete the hands-on lab in AccessOps.
- ReadingLesson Guide · 14 min
Audit trails for sensitive commands, correlation IDs, secrets management, environment configuration, logging without leaking data. What this means for a developer securing a production Wisej.NET app — and how to read this module.
- ReadingLab / Exam Guide · 10 min
What you'll build in the hands-on lab, the suggested approach, and the required deliverables.
- Video lessonAdd audit trails and take secrets out of the code · 14 min
Add audit trails and take secrets out of the code — a guided Module 6 walkthrough, built step by step in AccessOps. Runs right here in the player.
Narration transcript
Make security decisions explainable after the event. AccessOps needs evidence of allowed and denied actions, alongside secret management that does not expose credentials through source or logs.
Consider an investigation after operational logs have rotated. Current approval state cannot explain actors or failed attempts, and removing a secret today does not erase repository history.
Record actor, action, target, time, source, outcome, and correlation together. Insert-only access and chained integrity help detect missing history rather than merely preserving final business state.
Move credentials into environment-appropriate configuration outside source. Define rotation with overlapping valid credentials so replacement becomes a planned operating procedure rather than an improvised outage.
Create correlation at command entry and carry it through the logging scope. Commit audit with approval so their records describe the same completed transaction.
Load configuration through the intended providers and restrict logged properties. Redact sensitive tokens, cookies, and headers at the logging destination before they become persistent records.
Inspect the successful approval and the earlier refused download. The denied action may explain the investigation, so auditing only successful changes would leave a critical gap.
Use one correlation value to reconstruct the action across services. The connected sequence should contain no passwords, tokens, personal names, or connection credentials.
Deliver append-only auditing, propagated correlation, external secrets, and a rotation procedure. Review redaction so evidence collected for security does not become another disclosure source.
- ReadingAI Coding Exercise · 20 min
Build this module's AccessOps sample with ChatGPT or Claude from a ready-made prompt that points the model at this module's specification, then review, run and extend what it gives you.
- Knowledge checkModule 6 Knowledge Check · 10 min · Pass mark 80%
- Hands-on labLab — Audit Trail and Secrets · 45 min
Objective: Add auditing and secret management to AccessOps: an AuditService that records approvals, permission changes and document downloads with user, time, address and correlation ID, an append-only audit table, a correlation ID created per command and written to every log line, connection strings and the OIDC client secret moved to environment configuration with a documented rotation procedure, and a log review that redacts sensitive fields. Deliverables: AuditService and append-only audit table; Correlation ID in every command and log line; Secrets moved to environment configuration; Secret rotation procedure; Log redaction review.
Module 7: Hardening Checklist and Capstone
Module 7 of Security & Auth Patterns — the Wisej.NET security track. Read the lesson guide and the lab / exam guide, watch the hardening checklist walkthrough, pass the knowledge check, then complete the hands-on lab in AccessOps.
- ReadingLesson Guide · 14 min
HTTPS and security headers, cookie flags, session settings, dependency updates, rate limiting, deployment hardening and the AccessOps security review. What this means for a developer securing a production Wisej.NET app — and how to read this module.
- ReadingLab / Exam Guide · 10 min
What you'll build in the hands-on lab, the suggested approach, and the required deliverables.
- Video lessonHarden and ship AccessOps · 14 min
Harden and ship AccessOps — a guided Module 7 walkthrough, built step by step in AccessOps. Runs right here in the player.
Narration transcript
Extend the review from application code to its host. Password checks and permissions cannot compensate for weak transport, session settings, or unreviewed dependencies in the deployment.
Inspect transport, cookies, framing, repeated sign-ins, and dependency advisories. These problems can exist with correct business logic, so deployment needs its own security review.
Apply response policies consistently and evaluate content policy before enforcement. They constrain browser behavior, including framing and content interpretation, across the application's responses.
Configure cookie protections alongside session timeout, request size, and rate limits. These controls bound different resources and exposures; one setting cannot replace the others.
Follow middleware order from forwarded headers through redirects and protective policies. Registering these before the application handler ensures its responses pass through the intended protections.
Limit share links at their request boundary, but limit sign-in inside the service. A shared event endpoint cannot distinguish the expensive login action merely by its address.
Inspect actual encrypted responses, cookie attributes, and the separate share-link handler. Configuration alone does not prove that every response carries the required protection.
Run the checklist against the deployed application and review dependency findings with explicit decisions. Resolve demonstrated gaps before sign-off rather than treating configuration files as proof.
Deliver transport and response policies, session limits, targeted rate controls, and a dated dependency review. The completed checklist should reflect observed behavior across all seven modules.
- ReadingAI Coding Exercise · 20 min
Build this module's AccessOps sample with ChatGPT or Claude from a ready-made prompt that points the model at this module's specification, then review, run and extend what it gives you.
- Knowledge checkModule 7 Knowledge Check · 10 min · Pass mark 80%
- Hands-on labLab — Hardening Review and Capstone · 45 min
Objective: Complete the AccessOps capstone: enforce HTTPS with HSTS and set security headers, mark cookies Secure and HttpOnly with a strict SameSite policy, set session timeout and request size limits, add rate limiting on login and share links, run a dependency audit and record the results, then walk the full checklist from this course against the app and fix every finding. Deliverables: HTTPS, HSTS and security header configuration; Cookie and session hardening settings; Rate limiting on login and share links; Dependency audit report; Completed security review checklist with fixes.