Pular para o conteúdo principal
Versão: 10.4.1

ITLab.Template.DevPack.Identity.AuthSettings

Contains provider-specific authentication settings bound from tenant or application configuration.

Componentes

TipoNomeResponsabilidade
ClassTenantAuthenticationSettingsDtoAggregates all provider settings for one tenant
ClassEntraIdSettingsDtoRoot Entra ID configuration with enabled flag and app registrations
Abstract ClassBaseEntraIdAppRegistrationShared base settings for all Entra app registrations (ClientId, TenantId, etc.)
ClassEntraIdWebApiSettingsDtoEntra Web API registration settings
ClassEntraIdSpaSettingsDtoEntra SPA registration settings
ClassEntraIdAgentSettingsDtoEntra agent/native app registration settings
ClassDefaultProviderSettingsDtoToggle for the default (username/password) auth provider
ClassLdapSettingsDtoToggle 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 BaseEntraIdAppRegistration for 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.