public static IServiceCollection AddSecurityProvider(this IServiceCollection services, Action <SecurityProviderOptions> setupAction) { if (setupAction == null) { throw new ArgumentNullException(); } var options = new SecurityProviderOptions(); setupAction(options); foreach (var serviceExtension in options.Extensions) { serviceExtension.AddServices(services); } services.AddSingleton(options); return(services); }
public static SecurityProviderOptions UseJwt(this SecurityProviderOptions options) { options.RegisterExtension(new JwtOptionExtensions()); return(options); }