示例#1
0
        public WeeeCookieAuthenticationProvider(IReturnUrlMapping returnUrlMapping)
        {
            this.returnUrlMapping = returnUrlMapping;

            AdminAreaName  = "admin";
            AdminLoginPath = "/admin/account/sign-in";

            OnValidateIdentity = async context =>
            {
                CheckAccessToken(context);
                await IdentityValidationHelper.TransformClaims(context);
            };

            // Add our custom login to the redirect before applying the deafult implementation.
            OnApplyRedirect = (context) =>
            {
                ErrorIfAlreadyAuthenticated(context);
                UpdateRedirectUrlToAdminLoginPageIfNecessary(context);
                ApplyReturnUrlMapping(context);
                defaultImplementation.ApplyRedirect(context);
            };
        }
 public void ApplyRedirect(CookieApplyRedirectContext context)
 {
     OnApplyingRedirect.Invoke(context);
     _cookieAuthenticationProvider.ApplyRedirect(context);
     OnRedirectApplied.Invoke(context);
 }