当前位置: 首页>>代码示例>>C#>>正文


C# IAppBuilder.UseSequin方法代码示例

本文整理汇总了C#中IAppBuilder.UseSequin方法的典型用法代码示例。如果您正苦于以下问题:C# IAppBuilder.UseSequin方法的具体用法?C# IAppBuilder.UseSequin怎么用?C# IAppBuilder.UseSequin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IAppBuilder的用法示例。


在下文中一共展示了IAppBuilder.UseSequin方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Configuration

        public void Configuration(IAppBuilder app)
        {

            // Force sign-in with role
            app.Use(new Func<AppFunc, AppFunc>(next => (async env =>
                                                              {
                                                                  var context = new OwinContext(env);
                                                                  var claims = new List<Claim>
                                                                               {
                                                                                   new Claim("role", "SomeRole")
                                                                               };

                                                                  context.Request.User = new ClaimsPrincipal(new ClaimsIdentity(claims, "SomeAuthType"));

                                                                  await next.Invoke(env);
                                                              })));

            app.UseSequin(SequinOptions.Configure()
                                       .WithOwinDefaults()
                                       .WithPipeline(x => new OptOutCommandAuthorization(new OwinIdentityProvider())
                                                          {
                                                              Next = x.IssueCommand
                                                          })
                                       .Build(), new []
                                                 {
                                                     new ResponseMiddleware(typeof (UnauthorizedCommandResponseMiddleware))
                                                 });
        }
开发者ID:sequin,项目名称:sequin.claimsauthentication,代码行数:28,代码来源:Startup.cs

示例2: Configuration

 public void Configuration(IAppBuilder app)
 {
     var container = ConfigureAutofac();
     app.UseSequin(new SequinOptions
     {
         HandlerFactory = new AutofacHandlerFactory(container)
     });
 }
开发者ID:ritasker,项目名称:sequin,代码行数:8,代码来源:Startup.cs

示例3: Configuration

        public void Configuration(IAppBuilder app)
        {
            var container = ConfigureAutofac();

            app.UseSequin(SequinOptions.Configure()
                                       .WithOwinDefaults()
                                       .WithHandlerFactory(x => new AutofacHandlerFactory(container))
                                       .Build());
        }
开发者ID:sequin,项目名称:sequin.autofac,代码行数:9,代码来源:Startup.cs

示例4: Configuration

 public void Configuration(IAppBuilder app)
 {
     app.UseSequin(SequinOptions.Configure()
                                .WithOwinDefaults()
                                .WithPipeline(x => new ValidateCommand(new LazyValidatorFactory())
                                                   {
                                                       Next = x.IssueCommand
                                                   })
                                .Build(), new[]
                                          {
                                              new ResponseMiddleware(typeof(CommandValidationResponseMiddleware), new DefaultDictionaryFormatter())
                                          });
 }
开发者ID:sequin,项目名称:sequin.fluentvalidation,代码行数:13,代码来源:Startup.cs


注:本文中的IAppBuilder.UseSequin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。