示例#1
0
            public CustomDependencyScope(IKernel kernel, IDependencyResolver currentResolver)
            {
                if (kernel == null)
                {
                    throw new ArgumentNullException(nameof(kernel));
                }
                if (currentResolver == null)
                {
                    throw new ArgumentNullException(nameof(currentResolver));
                }

                _kernel = kernel;

                _windsorScope         = kernel.BeginScope();
                _currentResolverScope = currentResolver.BeginScope();
            }
示例#2
0
        private void ConfigureAuth(IAppBuilder app, System.Web.Http.Dependencies.IDependencyResolver dependencyResolver)
        {
            var sharePointAuthenticationOptions = new SharePointAuthenticationOptions()
            {
                DependencyResolver          = dependencyResolver,
                TokenCacheDurationInMinutes = ConfigurationManager.AppSettings["app:TokenCacheDurationInMinutes"] == null
                ? 10 : Convert.ToInt32(ConfigurationManager.AppSettings["app:TokenCacheDurationInMinutes"]),
                AllowNonBrowserRequests       = false,
                InjectCredentialsForHighTrust = true,
                ValidateIssuer            = true,
                ValidateAudience          = true,
                ValidateIssuerSigningKeys = true,
                ClockSkew = TimeSpan.Zero,
            };

            sharePointAuthenticationOptions.OnAuthenticationHandlerPostAuthenticate += OnAuthenticationHandlerPostAuthenticate;
            app.Use <SharePointAuthenticationMiddleware>(sharePointAuthenticationOptions);
        }
示例#3
0
 public CohortDependencyResolver(Container container, IDependencyResolver fallback) : base(container, fallback)
 {
     // Scopeless
 }
示例#4
0
 public CohortDependencyScope(Container container, IDependencyResolver fallback)
 {
     _container = container;
     _fallback  = fallback;
 }
 public CohortDependencyResolver(Container container, IDependencyResolver fallback) : base(container, fallback)
 {
     // Scopeless
 }
 public CohortDependencyScope(Container container, IDependencyResolver fallback)
 {
     _container = container;
     _fallback = fallback;
 }
示例#7
0
 public CustomDependencyResolver(IKernel kernel, IDependencyResolver currentResolver)
 {
     _kernel          = kernel;
     _currentResolver = currentResolver;
 }