コード例 #1
0
        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);
        }
コード例 #2
0
 public static SecurityProviderOptions UseJwt(this SecurityProviderOptions options)
 {
     options.RegisterExtension(new JwtOptionExtensions());
     return(options);
 }