Class AuthenticationBuilderExtensions
- Namespace
- NuvTools.Security.AspNetCore.Entra
- Assembly
- NuvTools.Security.AspNetCore.Entra.dll
Registers the Entra workload scheme.
public static class AuthenticationBuilderExtensions
- Inheritance
-
AuthenticationBuilderExtensions
- Inherited Members
Methods
AddEntraWorkload(AuthenticationBuilder, string, Action<EntraWorkloadOptions>)
Adds a bearer scheme that admits an Entra token issued for Audience to one of AllowedApplicationIds, and nothing else.
public static AuthenticationBuilder AddEntraWorkload(this AuthenticationBuilder builder, string scheme, Action<EntraWorkloadOptions> configure)
Parameters
builderAuthenticationBuilderThe authentication builder.
schemestringThe scheme's name, which the guarded endpoints name.
configureAction<EntraWorkloadOptions>Fills in the tenant, the audience and the allowed applications.
Returns
Remarks
For service-to-service calls with no secret: the caller is a managed identity, which asks Entra
for a token per call (DefaultAzureCredential), and nothing on either side holds a
credential to rotate or leak.
Both issuer forms are accepted, because a managed identity is normally issued a v1 token
(sts.windows.net) while the signing keys are read from the v2 metadata; the keys are the
same set. Claims keep their token names (EntraWorkloadClaims).
Unconfigured means refuse: the scheme then has no signing keys and admits nobody. It is never the default scheme by accident — name it on the endpoints it guards.