Class ExternalLoginProvisioningExtensions
- Namespace
- Microsoft.Extensions.DependencyInjection
- Assembly
- Stratara.Identity.AspNetCore.dll
DI extensions for hardened JIT external-login provisioning — creating or linking a local ASP.NET Identity account on a user's first OpenID Connect sign-in.
public static class ExternalLoginProvisioningExtensions
- Inheritance
-
ExternalLoginProvisioningExtensions
- Inherited Members
Methods
AddStrataraExternalLoginProvisioning<TUser>(IServiceCollection, Action<ExternalLoginProvisioningOptions>?)
Register ExternalLoginProvisioningService<TUser> and its options. Call the
service from your external-sign-in callback with the result of
SignInManager.GetExternalLoginInfoAsync(). The security invariants (verified-email
linking, fail-closed behavior) are on by default; use configure only to
relax them deliberately or to add an invitation gate.
public static IServiceCollection AddStrataraExternalLoginProvisioning<TUser>(this IServiceCollection services, Action<ExternalLoginProvisioningOptions>? configure = null) where TUser : IdentityUser, new()
Parameters
servicesIServiceCollectionThe service collection to mutate.
configureAction<ExternalLoginProvisioningOptions>Optional callback to configure the provisioning options.
Returns
- IServiceCollection
The same service collection, to enable chaining.
Type Parameters
TUserThe host's ASP.NET Identity user entity.
Examples
Creates or links the local account on a first external sign-in, fail-closed — an unverified external email does not link to an existing account:
services.AddStrataraExternalLoginProvisioning<ApplicationUser>();
Exceptions
- ArgumentNullException
servicesisnull.