Intelli Onboard
A secure, multi-tenant .NET application used by tenant teams to create student identities, student profiles, and supporting-document records while storing document files in Azure Blob Storage.
c47d09d0-29c6-4b4e-9a0c-aa7f849baea41. Purpose and scope
Intelli Onboard enables authorised staff to onboard a new student for their own tenant. Every read and write is tenant-specific. A successful submission creates the application user in UserExtended, creates the one-to-one Student profile, uploads each accepted file to Azure Blob Storage, and stores searchable file metadata in StudentDocument.
Roles
| Role | Access |
|---|---|
Tenant_Admin | Full access to all Intelli Onboard functionality within the authenticated tenant. |
Tenant_User | Can access Login and Onboard Student and create student onboarding records within the authenticated tenant. |
2. Multi-tenant security boundary
- Derive
UserExtendedIdandTenantIdfrom the authenticated server-side identity; never accept tenant context from the browser. - Every database query and mutation must include the authenticated
TenantId. - Login validates the active user, then joins
UserExtendedRoleMappingto the product identified by the fixed ProjectHash. - Grant access only when the mapping contains an active
Tenant_AdminorTenant_Userrole for Intelli Onboard. - Define ProjectHash once as a hardcoded
Guidexposed by a singleton project-identity service. Do not regenerate it or accept an override from a request.
3. Login
- Accept email and password and return a generic error for invalid credentials.
- Verify a secure password hash, active user status, tenant status, and the product-specific role mapping.
- Create a secure HTTP-only authentication cookie containing only necessary claims; retrieve authoritative tenant and role information server-side.
- Use HTTPS, antiforgery protection, safe local return URLs, lockout/rate limiting, and production-safe logs.
4. Onboard Student page
| Field | Rule |
|---|---|
| Name, Surname, Email | Required; trim and validate. Email must satisfy the agreed tenant uniqueness rule. |
| Mobile | Optional; normalise and validate when supplied. |
| Father Name, Mother Name | Optional student profile fields. |
| UID Number | Optional unless the tenant policy requires it; unique within the tenant when supplied. |
| Password, Retype Password | Must match and satisfy password policy. Hash before persistence; never store or log plain text. |
| Upload Documents | Multiple files. Allow-list extensions/MIME types, enforce per-file and request limits, sanitise display names, and virus-scan if available. Show every selected file with its size and a Remove action so an incorrect selection can be removed before submission. |
The server must use one database transaction for UserExtended and Student. Blob uploads and metadata writes need compensating cleanup so a failed request does not leave orphaned blobs or partial document records.
4.1 Find and Update Student
- Search by email, UID number, or student ID, always within the authenticated tenant.
- Load the selected UserExtended and one-to-one Student details for editing only after rechecking tenant ownership.
- Allow authorised users to update name, surname, email, mobile, parent names, and UID with the same validation and uniqueness rules used during creation.
- Display existing documents and allow removal with confirmation. Delete both the StudentDocument record and its authorised Blob, using retryable/idempotent cleanup and an audit record.
- Allow multiple new documents, each with a pre-save Remove action. Save profile and document changes safely without exposing cross-tenant records.
5. Data model
| Entity | Required design |
|---|---|
UserExtended | Existing user record. Save TenantId, name, surname, email, mobile, secure password identity reference/hash, active status, audit fields, and other existing required fields. |
Student | UserExtendedId is the primary key and foreign key, enforcing a one-to-one relationship. Store FatherName, MotherName, UIDNumber, and appropriate audit fields. |
StudentDocument | Id, UserExtendedId, DocumentName, FileSize, FileType, Extension, FilePath, plus recommended TenantId and audit fields for defence-in-depth and traceability. |
6. Azure Blob Storage
Store document bytes in a private Blob container. Generate the logical blob path on the server:
{TenantId}/{StudentId}/{DocumentName-or-unique-id}.{extension}
The requested convention TenantId/StudentId/Document.extension is preserved. Use a collision-safe server-generated blob name while keeping the original name in DocumentName. Store the canonical blob path—not a temporary SAS URL—in FilePath. Access must be authorised in the app and use short-lived SAS URLs or server streaming.
7. Configuration and environments
- Local development connects to Microsoft SQL Server using
ConnectionStrings:DefaultConnectionsupplied through user secrets or a local uncommitted setting. - Azure App Service supplies the production database connection string and Blob configuration through App Service Configuration or Key Vault references.
- Use managed identity for Azure Storage where practical. Never commit account keys, database passwords, or SAS tokens.
- Provide migrations/idempotent SQL for the two new tables and indexes for TenantId, email, UID, and document ownership lookups.
8. Acceptance criteria
- Only an active user with a valid Intelli Onboard product-role mapping can log in.
- Tenant Admin and Tenant User can onboard and update a student only for their authenticated tenant.
- A valid request creates exactly one UserExtended row and its one-to-one Student row.
- Each selected upload shows a working Remove action before submission.
- Users can find a same-tenant student by email, UID, or student ID and update the authorised profile.
- Multiple valid documents upload under the correct tenant/student blob prefix and each gets one StudentDocument record; confirmed existing-document removal deletes metadata and Blob safely.
- Cross-tenant requests and object references are denied and audited.
- Validation or infrastructure failure produces a safe error and leaves no unintended partial student or orphaned document data.
- The application runs against local SQL Server and can be deployed to Azure App Service using the provided guides.
9. Database creation queries
Create the tenant-aware Student and StudentDocument tables with the idempotent SQL Server script. It verifies shared dependencies and checks tables and indexes before creating anything.