示例#1
0
        // For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
        public void ConfigureAuth(IAppBuilder app, IAppConfiguration config)
        {
            ReturnUrlMapping returnUrlMapping = new ReturnUrlMapping();

            returnUrlMapping.Add("/account/sign-out", null);
            returnUrlMapping.Add("/admin/account/sign-out", null);

            app.UseCookieAuthentication(new CookieAuthenticationOptions()
            {
                AuthenticationType = Constants.WeeeAuthType,
                LoginPath          = new PathString("/account/sign-in"),
                SlidingExpiration  = true,
                ExpireTimeSpan     = TimeSpan.FromMinutes(180),
                CookieName         = EA.Prsd.Core.Web.Constants.CookiePrefix + Constants.WeeeAuthType,
                Provider           = new WeeeCookieAuthenticationProvider(returnUrlMapping)
            });
        }
示例#2
0
        public void ApplyMap_WithMapping_ReturnsMappedPath()
        {
            // Arrange
            ReturnUrlMapping mapping = new ReturnUrlMapping("/");

            mapping.Add("/controller1/action1", "/controller2/action2");

            // Act
            string result = mapping.ApplyMap("/controller1/action1");

            // Assert
            Assert.Equal("/controller2/action2", result);
        }
示例#3
0
        public void IsMapped_WithMappingAndApplicationVirtualPath_ReturnsTrue()
        {
            // Arrange
            ReturnUrlMapping mapping = new ReturnUrlMapping("/weee");

            mapping.Add("/controller1/action1", "/controller2/action2");

            // Act
            bool result = mapping.IsMapped("/weee/controller1/action1");

            // Assert
            Assert.Equal(true, result);
        }