public ForceRenewalCookieAuthenticationMiddleware(
     OwinMiddleware next,
     IAppBuilder app,
     UmbracoBackOfficeCookieAuthOptions options,
     IUmbracoContextAccessor umbracoContextAccessor) : base(next, app, options)
 {
     _umbracoContextAccessor = umbracoContextAccessor;
 }
 public GetUserSecondsMiddleWare(
     OwinMiddleware next,
     UmbracoBackOfficeCookieAuthOptions authOptions,
     IGlobalSettings globalSettings,
     ISecuritySection security,
     ILogger logger)
     : base(next)
 {
     _authOptions    = authOptions ?? throw new ArgumentNullException(nameof(authOptions));
     _globalSettings = globalSettings;
     _security       = security;
     _logger         = logger ?? throw new ArgumentNullException(nameof(logger));
 }
Exemple #3
0
        /// <summary>
        /// Create the default umb cookie auth options
        /// </summary>
        /// <param name="app"></param>
        /// <param name="umbracoContextAccessor"></param>
        /// <param name="globalSettings"></param>
        /// <param name="runtimeState"></param>
        /// <param name="securitySettings"></param>
        /// <param name="explicitPaths"></param>
        /// <returns></returns>
        public static UmbracoBackOfficeCookieAuthOptions CreateUmbracoCookieAuthOptions(this IAppBuilder app,
                                                                                        IUmbracoContextAccessor umbracoContextAccessor,
                                                                                        IGlobalSettings globalSettings, IRuntimeState runtimeState, ISecuritySection securitySettings, string[] explicitPaths = null)
        {
            //this is how aspnet wires up the default AuthenticationTicket protector so we'll use the same code
            var ticketDataFormat = new TicketDataFormat(
                app.CreateDataProtector(typeof(CookieAuthenticationMiddleware).FullName,
                                        Constants.Security.BackOfficeAuthenticationType,
                                        "v1"));

            var authOptions = new UmbracoBackOfficeCookieAuthOptions(
                explicitPaths,
                umbracoContextAccessor,
                securitySettings,
                globalSettings,
                runtimeState,
                ticketDataFormat);

            return(authOptions);
        }
 /// <summary>
 /// Instantiates the middleware with an optional pointer to the next component.
 /// </summary>
 /// <param name="next"/>
 /// <param name="cookieOptions"></param>
 /// <param name="globalSettings"></param>
 public PreviewAuthenticationMiddleware(OwinMiddleware next,
                                        UmbracoBackOfficeCookieAuthOptions cookieOptions, IGlobalSettings globalSettings) : base(next)
 {
     _cookieOptions  = cookieOptions;
     _globalSettings = globalSettings;
 }