Class DemoIdentityServiceExtensions
- Namespace
- ReferenceApplication.Web.Authentication.Extensions
- Assembly
- ReferenceApplication.Web.dll
Registers and maps the explicitly enabled, Development-only demo identity control.
public static class DemoIdentityServiceExtensions
- Inheritance
-
DemoIdentityServiceExtensions
- Inherited Members
Methods
AddApplicationDemoIdentity(IServiceCollection, IConfiguration, IHostEnvironment)
Adds the demo identity service only when the host is running in Development and the explicit switch is enabled.
public static IServiceCollection AddApplicationDemoIdentity(this IServiceCollection services, IConfiguration configuration, IHostEnvironment environment)
Parameters
servicesIServiceCollectionThe service collection to configure.
configurationIConfigurationThe application configuration.
environmentIHostEnvironmentThe host environment.
Returns
- IServiceCollection
The same service collection for chaining.
IsDemoIdentityActive(IConfiguration, IHostEnvironment)
Determines whether the demo identity control is active for the supplied host configuration.
public static bool IsDemoIdentityActive(IConfiguration configuration, IHostEnvironment environment)
Parameters
configurationIConfigurationThe application configuration.
environmentIHostEnvironmentThe host environment.
Returns
MapApplicationDemoIdentity(WebApplication)
Maps the demo sign-in endpoint when the demo identity service was registered.
public static WebApplication MapApplicationDemoIdentity(this WebApplication app)
Parameters
appWebApplicationThe application whose endpoint should be mapped.
Returns
- WebApplication
The same application for chaining.
UseApplicationDemoDatabase(WebApplicationBuilder)
Selects the disposable SQLite database before data-access services are registered when the Development demo is active. Non-Development and disabled hosts retain their configured provider and connection string.
public static WebApplicationBuilder UseApplicationDemoDatabase(this WebApplicationBuilder builder)
Parameters
builderWebApplicationBuilderThe application builder to configure.
Returns
- WebApplicationBuilder
The same builder for chaining.