CasCap.Api.Azure.Auth
1.6.4
Prefix Reserved
See the version list below for details.
dotnet add package CasCap.Api.Azure.Auth --version 1.6.4
NuGet\Install-Package CasCap.Api.Azure.Auth -Version 1.6.4
<PackageReference Include="CasCap.Api.Azure.Auth" Version="1.6.4" />
<PackageVersion Include="CasCap.Api.Azure.Auth" Version="1.6.4" />
<PackageReference Include="CasCap.Api.Azure.Auth" />
paket add CasCap.Api.Azure.Auth --version 1.6.4
#r "nuget: CasCap.Api.Azure.Auth, 1.6.4"
#:package CasCap.Api.Azure.Auth@1.6.4
#addin nuget:?package=CasCap.Api.Azure.Auth&version=1.6.4
#tool nuget:?package=CasCap.Api.Azure.Auth&version=1.6.4
CasCap.Api.Azure.Auth
Azure authentication helpers that give applications one configuration model and credential factory across development, Edge, and Azure-hosted environments:
- Developer workstations can load a client certificate from the current user's certificate store, a combined PEM file, or a PFX file.
- Edge and self-managed deployments can mount one combined PEM or PFX client certificate without requiring Azure Arc, cluster membership in Entra ID, or a cloud-managed node identity.
- Azure-hosted Kubernetes workloads can use federated workload identity. The library detects the
injected Azure environment and creates a
WorkloadIdentityCredentialwithout a certificate or client secret. - Local or disconnected environments can disable Key Vault integration explicitly and use other configuration providers.
Every enabled path produces an Azure SDK TokenCredential, so the application can use the same
startup and dependency-injection flow for Key Vault, Storage, Event Hubs, Service Bus, and other
token-aware Azure clients.
flowchart LR
DEV["Developer workstation"] --> STORE["Certificate store"]
DEV --> FILE["Combined PEM or PFX"]
EDGE["Edge / self-managed"] --> FILE
AZURE["Azure-hosted Kubernetes"] --> FEDERATED["Federated service-account token"]
STORE --> CLIENT_CERT["ClientCertificateCredential"]
FILE --> CLIENT_CERT
FEDERATED --> WORKLOAD["WorkloadIdentityCredential"]
CLIENT_CERT --> SDK["Azure SDK clients"]
WORKLOAD --> SDK
Installation
dotnet add package CasCap.Api.Azure.Auth
Target frameworks: net8.0, net9.0, net10.0
Services / Extensions
| Type | Name | Description |
|---|---|---|
| Interface | IAzureAuthConfig |
Exposes Azure authentication configuration: Key Vault name/URI, Entra ID tenant/application IDs, certificate thumbprint, combined PEM path, or PFX path/password, and a lazily-resolved TokenCredential. Provides IsKeyVaultEnabled to allow Key Vault-free operation. |
| Static factory | TokenCredentialExtensions |
Creates WorkloadIdentityCredential from injected Kubernetes workload-identity environment variables, or ClientCertificateCredential from one configured certificate source. |
Key Methods
TokenCredentialExtensions.IsPodManagedIdentity— Checks whether the current pod is using Azure workload identity (federated tokens).TokenCredentialExtensions.CreateTokenCredential(IAzureAuthConfig)— Creates aWorkloadIdentityCredentialwhen the Kubernetes workload-identity environment is present; otherwise creates aClientCertificateCredentialfrom the configured certificate source, or returnsnull.
Configuration
| Class | Section | Properties |
|---|---|---|
AzureAuthConfig |
AppConfig |
KeyVaultName (required), IsKeyVaultEnabled (computed), AzureEntraPodManagedIdentityClientId, AzureEntraTenantId, AzureEntraApplicationId, AzureEntraCertThumbprint, AzureEntraPemPath, AzureEntraPfxPath, AzureEntraPfxPassword |
AzureAuthConfig implements both IAppConfig and IAzureAuthConfig. The TokenCredential property is lazily created from the certificate properties via TokenCredentialExtensions.
Azure workload identity is selected when AZURE_CLIENT_ID, AZURE_TENANT_ID,
AZURE_FEDERATED_TOKEN_FILE, and AZURE_AUTHORITY_HOST are all present. The injected
AZURE_CLIENT_ID is used by default; AzureEntraPodManagedIdentityClientId can explicitly select a
different registered client ID. Certificate configuration is ignored in this environment because
workload identity has priority.
Configure exactly one certificate source. Supplying more than one fails explicitly rather than silently selecting one:
AzureEntraCertThumbprintselects a certificate from the current user's certificate store.AzureEntraPemPathloads one combined PEM file containing the certificate and private key. This is the preferred format when the same credential is also consumed by External Secrets Operator.AzureEntraPfxPathloads a PKCS#12/PFX file, withAzureEntraPfxPasswordwhen it is protected.
PEM and PFX are alternative representations, not files to deploy together.
Developer Certificate Selection
For workstation development, install the certificate and private key into the current user's
Personal certificate store and keep AzureEntraCertThumbprint in the application's user-secrets
store. Each repository can have a different UserSecretsId, so rotating one shared certificate
requires updating every consuming repository's secrets.json.
Do not place workstation thumbprints or paths in tracked configuration. Also remove deployment-only PEM/PFX path values from local providers loaded on the workstation: configuring a thumbprint and a file path together fails explicitly instead of silently selecting one.
Running Without Key Vault
Set KeyVaultName to "skip" (case-insensitive) to disable Key Vault integration entirely. When IsKeyVaultEnabled returns false:
- The application skips adding Azure Key Vault as a configuration source at startup.
TokenCredentialis not resolved (no certificate lookup is attempted).- Secrets must be supplied via alternative configuration sources (environment variables, user secrets, or
appsettings.json). - Sink services that use
StorageExtensions.CreateTableClient()automatically fall back to connection strings when the connection string contains;(e.g. Azurite emulator).
Override via any configuration source:
- Environment variable:
AppConfig__KeyVaultName=skip - User secrets:
{ "AppConfig": { "KeyVaultName": "skip" } } - appsettings override: same JSON shape
Credential Resolution
Credential Resolution Priority:
- Skip sentinel —
KeyVaultName = "skip"→null(no credential, no Key Vault) - Azure Workload Identity (Kubernetes pod with federated token) — auto-detected
- Certificate thumbprint — searches
LocalMachine\Mycertificate store - Combined PEM file — loads the certificate and private key from one file
- PFX file — loads certificate from path with optional password
- null — no credential available
Certificate source configuration is mutually exclusive; the numbered list documents supported sources, not fallback precedence between simultaneously configured values.
Dependencies
NuGet Packages
| Package |
|---|
| Azure.Identity |
| CasCap.Common.Abstractions |
| CasCap.Common.Extensions |
| CasCap.Common.Logging |
Project References
None.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Azure.Identity (>= 1.21.0)
- CasCap.Common.Abstractions (>= 4.14.4)
- CasCap.Common.Extensions (>= 4.14.4)
- CasCap.Common.Logging (>= 4.14.4)
-
net8.0
- Azure.Identity (>= 1.21.0)
- CasCap.Common.Abstractions (>= 4.14.4)
- CasCap.Common.Extensions (>= 4.14.4)
- CasCap.Common.Logging (>= 4.14.4)
-
net9.0
- Azure.Identity (>= 1.21.0)
- CasCap.Common.Abstractions (>= 4.14.4)
- CasCap.Common.Extensions (>= 4.14.4)
- CasCap.Common.Logging (>= 4.14.4)
NuGet packages (5)
Showing the top 5 NuGet packages that depend on CasCap.Api.Azure.Auth:
| Package | Downloads |
|---|---|
|
CasCap.Api.DoorBird.Sinks
Pluggable event sink implementations (Redis, Azure Tables, Azure Blob Storage) for the CasCap.Api.DoorBird door station integration library. |
|
|
CasCap.Api.Buderus.Sinks
Pluggable event sink implementations (Redis, Azure Tables) for the CasCap.Api.Buderus heating integration library. |
|
|
CasCap.Api.Fronius.Sinks
Pluggable event sink implementations (Redis, Azure Tables) for the CasCap.Api.Fronius solar inverter integration library. |
|
|
CasCap.Api.Knx.Sinks
Pluggable event sink implementations (Redis, Azure Tables) for the CasCap.Api.Knx building automation integration library. |
|
|
CasCap.Api.Voice
Provider-neutral speech-to-text and text-to-speech components for .NET applications. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 2.1.0 | 358 | 11/14/2026 |
| 2.0.0 | 457 | 11/5/2026 |
| 1.8.0 | 223 | 11/1/2026 |
| 1.7.1 | 370 | 10/24/2026 |
| 1.7.0 | 263 | 10/21/2026 |
| 1.6.4 | 201 | 10/4/2026 |
| 1.6.3 | 262 | 9/25/2026 |
| 1.6.2 | 224 | 9/23/2026 |
| 1.6.1 | 154 | 9/21/2026 |
| 1.6.0 | 307 | 9/19/2026 |
| 1.5.5 | 225 | 9/11/2026 |
| 1.5.4 | 141 | 9/1/2026 |
| 1.5.3 | 230 | 8/18/2026 |
| 1.5.2 | 242 | 7/15/2026 |
| 1.5.1 | 249 | 6/26/2026 |
| 1.5.0 | 333 | 6/12/2026 |
| 1.4.13 | 241 | 6/10/2026 |
| 1.4.12 | 262 | 5/27/2026 |
| 1.4.11 | 245 | 5/26/2026 |
| 1.4.10 | 199 | 5/21/2026 |