The solution (TELS.Auth.Api.sln) contains 6 projects:
| Project | Type | Framework | Description |
|---|---|---|---|
| TELS.Auth.Api | Web API | .NET 10.0 | Core authentication service — issues, refreshes, and validates JWT tokens for the TELS platform |
| TELS.Auth.Contracts | Library | .NET 8.0 | Shared DTOs and contract definitions for Auth domain consumers |
| TELS.Auth.Sdk | Library | .NET 8.0 / 10.0 | Multi-targeted SDK for service consumers — JWT validation, resilience, auth middleware |
| TELS.WebServices.Auth.Contracts | Library | .NET Standard 2.0 | Obsolete — legacy WebServices contracts, replaced by TELS.Auth.Contracts |
| Project | Type | Description |
|---|---|---|
| TELS.Auth.Api.Tests | xUnit (.NET 10.0) | Integration tests for controllers, logic, and data layers |
| TELS.Auth.Sdk.Tests | xUnit (.NET 8.0) | Unit tests for SDK components |
| Component | Type | Description |
|---|---|---|
| src/dbup/ | SQL Migrations | DbUp-based schema migrations for Auth database objects |
| src/k6tests/ | Load Tests | K6 (TypeScript) functional and smoke tests |
| terraform/ | Infrastructure | Terraform IaC for AWS ECS deployment |
The TELS Auth Service is the centralized authentication and authorization gateway for the TELS platform. It provides:
Token Issuance — Issues JWT access tokens (24h lifetime) and refresh tokens (365d lifetime) via multiple authentication flows: username/password, service-to-service trust, bearer token exchange, SSO/OpenID Connect, and Windows Authentication.
Token Validation — Validates and exchanges tokens across multiple signing algorithms (HS256, RS256, ES256), supporting both legacy HMAC-signed tokens and modern asymmetric key pairs.
Identity Resolution — Resolves user identity across multiple legacy databases (CONTACT, DSI_APP, MDID_BTRIEVE, DSHE_APP, TELS) to build comprehensive JWT claims including personas, facility access, and security group membership.
Token Revocation — Maintains a revocation registry supporting user-level and token-level revocations.
Authorization Queries — Provides role membership and access-point authorization checks for internal administration.
┌─────────────────────────────────────────────────────┐
│ Controllers (V1) │
│ TokenController, AuthorizationController, │
│ RevocationsController, DiagnosticController, │
│ BusinessUnitController │
├─────────────────────────────────────────────────────┤
│ Logic Layer │
│ TokenResponseService, TokenGenerator, │
│ JsonWebTokenService, ExternalIdentityService, │
│ TrustService, TokenAuthorityService, │
│ RevocationsService, SecurityEditorService, │
│ SecurityKeyManager, UserIdentityFactory, │
│ Identity/* (resolution & validation) │
├─────────────────────────────────────────────────────┤
│ Data Layer (Dapper + Stored Procedures) │
│ IdentityDataProvider, RevocationsDataProvider, │
│ SecurityEditorDataProvider │
├─────────────────────────────────────────────────────┤
│ SQL Server Databases │
│ TELS.Auth schema (owned), CONTACT.dbo, │
│ DSI_APP.dbo, MDID_BTRIEVE.dbo, DSHE_APP.dbo, │
│ TELS.dbo, TELS.Customers, TELS.LocalServices │
└─────────────────────────────────────────────────────┘
CommandType.StoredProcedureTELS.Auth — owns Revocations table + 14 stored procedures + 2 viewsSupports 7 distinct authentication flows:
- Refresh (POST /auth/token/refresh) — Exchange refresh token for new access + refresh tokens
- User/Password (POST /auth/token/user) — Direct credential authentication
- Trust (HMAC) (POST /auth/token/trust) — Service-to-service auth with HMAC-signed requests
- Trust (Simple) (POST /auth/token/trust-simple) — Service-to-service auth with shared secret
- Bearer Exchange (POST /auth/token/bearer) — Exchange an existing bearer token
- SSO/OpenID (POST /auth/token/openId, GET /auth/token/sso/initiate) — Microsoft Entra ID (Azure AD) integration
- Windows Auth (GET /auth/token/user/winauth) — IWA-based authentication (deprecated)
5 controllers exposing 15 endpoints under auth/:
[AuthorizeInternalAdministrator] — requires DirectSupplyPartner persona OR CustomerGlobalAdministrator role[FromAuth] model binding for ITokenClaimsSee API Documentation for full endpoint details.
| Category | Technology |
|---|---|
| Runtime | .NET 10.0 |
| Web Framework | ASP.NET Core 10.0 with API Versioning |
| Data Access | Dapper 2.1.66 |
| Database | SQL Server (Internal + External catalogs) |
| Authentication | JWT Bearer (Microsoft.IdentityModel 8.15.0) |
| SAML Support | Microsoft.IdentityModel.Tokens.Saml 8.15.0 |
| Resilience | Polly 8.6.5 (via Microsoft.Extensions.Http.Polly) |
| API Docs | Swashbuckle 10.1.0 (Swagger/OpenAPI) |
| Monitoring | New Relic Agent API 10.48.0 |
| Testing | xUnit 2.9.3, Moq 4.20.72, K6 (load tests) |
| Formatting | CSharpier |
| Versioning | Nerdbank.GitVersioning 3.9.50 |
| Environment | URL | SQL Server (Transactional) | SQL Server (DW) |
|---|---|---|---|
| DEV | https://devservices.tels.net/auth/ | SQL-DSHE-DEV-TRAN | SQL-DSI-I-DW |
| QA | https://qaservices.tels.net/auth/ | SQL-DSHE-QE-TRAN | SQL-DSI-I-DW |
| PROD | https://services.tels.net/auth/ | SQL-DSHE-PE-TRAN | SQL-DSI-I-DW |
| Stage | Jobs |
|---|---|
| Build | dotnet-build, container-build, terraform-verify |
| Test | dotnet-test, security scans (SAST, dependency, container), K6 functional tests |
| Publish | NuGet push (Contracts, Sdk, WebServices.Auth.Contracts) to ProGet |
| Deploy | Terraform plan → Container push → Terraform apply → DbUp → K6 smoke tests |
x-use-ecs: true header directs traffic to ECSX-Hosted-By: ECS response header identifies new deployment/terraform/ directory)| Configuration Group | Key Variables |
|---|---|
| Database | Internal + External SQL Server connection strings (IWA auth) |
| JWT | Issuer/audience validation, signing keys (symmetric, RSA, ECC) |
| Token Profiles | Algorithm selection, access token lifetime (24h), refresh token lifetime (365d) |
| External Identity | Microsoft Entra ID OAuth2 (client ID, tenant, authority) |
| Trust | Shared secrets per application key, trusted batch identities |
| Endpoints | Platform service URL, Customers service URL |
| Feature Flags | IncludeKeyIdInHeader, DsUserAsPartnerPersona, AlwaysPerformAccessChecks |
| Integration | Mechanism | Description |
|---|---|---|
| Microsoft Entra ID | OAuth2/OIDC | External identity provider for SSO and OpenID Connect flows |
| Customers Service | HTTP API (v2) | Facility access lookups (GET v2/businessUnits/{id}/facilityAccess) and facility search |
| Platform Service | HTTP API | Platform-level operations (endpoint configured) |
| CONTACT Database | Cross-DB SQL | User accounts, password lockout, person records, email routing |
| DSI_APP Database | Cross-DB SQL | DS user records, AD integration, contact relationships |
| MDID_BTRIEVE Database | Cross-DB SQL | Customer/supplier contact records and email addresses |
| DSHE_APP Database | Cross-DB SQL | Security groups, company/team/department hierarchy |
| TELS Database | Cross-DB SQL | Facility access views, customer schemas, service providers |
SqlServerTransientExceptionDetector for transient classification| Test Type | Project | Execution |
|---|---|---|
| Unit/Integration Tests | TELS.Auth.Api.Tests | xUnit — controllers, logic, data providers |
| SDK Tests | TELS.Auth.Sdk.Tests | xUnit — JWT validation, resilience |
| Load/Functional Tests | src/k6tests/ | K6 (TypeScript) — smoke tests per environment |
| Security Scanning | CI/CD pipeline | SAST, dependency scan, container scan |
| Package | Target | Published To |
|---|---|---|
| TELS.Auth.Contracts | .NET 8.0 | ProGet (proget.directsupply.cloud) |
| TELS.Auth.Sdk | .NET 8.0 / 10.0 | ProGet |
| TELS.WebServices.Auth.Contracts | .NET Standard 2.0 | ProGet (obsolete) |
Controllers:
- src/TELS.Auth.Api/Controllers/V1/TokenController.cs
- src/TELS.Auth.Api/Controllers/V1/AuthorizationController.cs
- src/TELS.Auth.Api/Controllers/V1/RevocationsController.cs
- src/TELS.Auth.Api/Controllers/V1/DiagnosticController.cs
- src/TELS.Auth.Api/Controllers/V1/BusinessUnitController.cs
Logic:
- src/TELS.Auth.Api/Logic/TokenResponseService.cs
- src/TELS.Auth.Api/Logic/TokenGenerator.cs
- src/TELS.Auth.Api/Logic/JsonWebTokenService.cs
- src/TELS.Auth.Api/Logic/TrustService.cs
- src/TELS.Auth.Api/Logic/Identity/
Data:
- src/TELS.Auth.Api/Data/IdentityDataProvider.cs
- src/TELS.Auth.Api/Data/RevocationsDataProvider.cs
- src/TELS.Auth.Api/Data/SecurityEditorDataProvider.cs
Database Migrations:
- src/dbup/scripts/
Contracts:
- src/TELS.Auth.Contracts/V1/
- src/TELS.WebServices.Auth.Contracts/
SDK:
- src/TELS.Auth.Sdk/V1/
TELS.WebServices.Auth.Contracts project is marked obsolete and is being replaced by TELS.Auth.Contracts. Both are still published to ProGet for backward compatibility.x-use-ecs header controls routing.BusinessUnitController is deprecated — proxies to Customers service and should be called directly.TELSSRVC_Auth service account.