// 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) }); }
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); }
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); }