コード例 #1
0
        public AuthenticationSchemeConfigurator(
            AuthenticationSchemeType authenticationSchemeType,
            IAuthenticationSchemeStore authenticationSchemeStore,
            IEnumerable <IPostConfigureOptions <TOptions> > postConfigurations,
            Func <AuthenticationSchemeData, TOptions> factory)
        {
            this.authenticationSchemeType  = authenticationSchemeType;
            this.authenticationSchemeStore = authenticationSchemeStore;

            this.postConfigurations = postConfigurations;

            this.factory = factory;
        }
コード例 #2
0
ファイル: Extensions.cs プロジェクト: yjpark/squidex-identity
        public static void AddAuthenticationConfigurator <TOptions, THandler>(this IServiceCollection services, AuthenticationSchemeType type, Func <AuthenticationSchemeData, TOptions> factory)
            where TOptions : AuthenticationSchemeOptions, new()
            where THandler : AuthenticationHandler <TOptions>
        {
            services.AddSingleton(c => new AuthenticationSchemeConfigurator <TOptions, THandler>(type,
                                                                                                 c.GetRequiredService <IAuthenticationSchemeStore>(),
                                                                                                 c.GetRequiredService <IEnumerable <IPostConfigureOptions <TOptions> > >(),
                                                                                                 factory));

            services.AddSingleton <IAuthenticationSchemeConfigurator>(c =>
                                                                      c.GetRequiredService <AuthenticationSchemeConfigurator <TOptions, THandler> >());

            services.AddSingleton <IOptionsMonitor <TOptions> >(c =>
                                                                c.GetRequiredService <AuthenticationSchemeConfigurator <TOptions, THandler> >());
        }