ITLab.Template.DevPack.Identity.AuthSettings
Contains provider-specific authentication settings bound from tenant or application configuration.
Componentes
| Tipo | Nome | Responsabilidade |
|---|---|---|
| Class | TenantAuthenticationSettingsDto | Aggregates all provider settings for one tenant |
| Class | EntraIdSettingsDto | Root Entra ID configuration with enabled flag and app registrations |
| Abstract Class | BaseEntraIdAppRegistration | Shared base settings for all Entra app registrations (ClientId, TenantId, etc.) |
| Class | EntraIdWebApiSettingsDto | Entra Web API registration settings |
| Class | EntraIdSpaSettingsDto | Entra SPA registration settings |
| Class | EntraIdAgentSettingsDto | Entra agent/native app registration settings |
| Class | DefaultProviderSettingsDto | Toggle for the default (username/password) auth provider |
| Class | LdapSettingsDto | Toggle and connection settings for the LDAP provider |
Como usar
// Example of per-tenant auth settings binding source.
var tenantAuth = configuration
.GetSection("TenantAuthentication")
.Get<TenantAuthenticationSettingsDto>();
if (tenantAuth?.EntraId?.Enabled == true)
{
// Configure Entra scheme for this tenant context.
var clientId = tenantAuth.EntraId.WebApi?.ClientId;
}
O que não fazer
- Do not store secrets (ClientSecret, passwords) in plain text logs.
- Do not assume every tenant enables the same provider.
- Do not derive from
BaseEntraIdAppRegistrationfor non-Entra providers.
Extensão pelo produto
- Products can extend the DTO graph with provider-specific fields in their own namespace.
- Shared fields should remain backward compatible to avoid breaking existing tenant configuration.