owin

UseWsFederationAuthentication - AuthenticationException: The remote certificate is invalid according to the validation procedure

给你一囗甜甜゛ 提交于 2019-12-06 10:45:18
I am getting an error every time I try to run my MVC project on my development box through VS2015 and IIS Express. It uses this code to authenticate against our ADFS server. app.SetDefaultSignInAsAuthenticationType(CookieAuthenticationDefaults.AuthenticationType); app.UseCookieAuthentication(new CookieAuthenticationOptions()); app.UseWsFederationAuthentication( new WsFederationAuthenticationOptions { Wtrealm = realm, MetadataAddress = adfsMetadata }); This is the error I am getting in the browser. [AuthenticationException: The remote certificate is invalid according to the validation procedure

Owin WebApi service ignoring ExceptionFilter

牧云@^-^@ 提交于 2019-12-06 09:32:28
Stack, For some reason my Owin WebApi service is ignoring our custom exception handler. I'm following documentation for asp.net exception handling . Here are the simplified implementation details (scrubbed out business proprietary stuff). Can you someone point out what I'm overlooking? Custom exception filter: public class CustomExceptionFilter : ExceptionFilterAttribute { public override void OnException(HttpActionExecutedContext actionExecutedContext) { actionExecutedContext.Response.StatusCode = HttpStatusCode.NotFound; actionExecutedContext.Response.Content = new StringContent("...my

Create Self Hosted Web API or Use Asp.Net Core Web API?

浪子不回头ぞ 提交于 2019-12-06 08:13:52
I have two options: If I self host Wep Api uisng OWIN/Katana I can have the performance gain but as mentioned here , I have to write code to have the features of IIS like logging, application pool scaling, throttling etc. Instead can I create API using Asp.Net Core which doesn't use unnecessary System.Web request pipeline ? And use the IIS features or Nginx Server features ? With performance in mind which is the best option ? Update: I mean , I don't want to use IIS , but i want to self host Web API with IIS features using custom code. or Will Asp .NET Core will help me to achieve this without

Can someone provide a CorsPolicy implementation with an explicit Origins list?

拈花ヽ惹草 提交于 2019-12-06 07:59:30
问题 Referring to the SignalR Hubs API Guide indicates the following information in the configuration comments: // Setup the CORS middleware to run before SignalR. // By default this will allow all origins. You can // configure the set of origins and/or http verbs by // providing a cors options with a different policy. map.UseCors(CorsOptions.AllowAll); however, the Origins property of System.Web.CorsPolicy has a private setter, no constructor that allows origins to be injected, and no exposed

Sharing owin identity cookie with MVC 5?

血红的双手。 提交于 2019-12-06 07:55:57
I´m doing SSO App with user managment in MVC 5, but i cant share the cookie between apps for example http ://SSO http ://app diferent sites in IIS, i think this is something like cross domain,so in the app2 when i have something like this in the startup.auth app.UseCookieAuthentication(new CookieAuthenticationOptions { CookieName = "sharedcookie", CookieDomain = "SSO", CookieHttpOnly = false, //CookieDomain = "localhost", AuthenticationType = DefaultAuthenticationTypes.ExternalCookie, LoginPath = new PathString("/Account/Login"), Provider = new CookieAuthenticationProvider { external login to

Got 400 error for pre-flight options CORS token request from OWIN-based WebAPI

元气小坏坏 提交于 2019-12-06 07:43:21
问题 It is really strange. I tried to make a CORS request to WebAPI2 (OWIN-based) to gain authentication token. It always fails every other times. like 1st request fails, but 2nd request will go through. And the 3rd fails, but the 4th will go through. I don't understand why it was working half of the times. I check the browser request (chrome). The one got failed always goes by OPTIONS method. The one went through always goes by POST. But I always use post method with headers 'Content-Type':

Why can't users authenticate after deploying locally the ASP.NET 4.6 application to the IIS 10 server?

帅比萌擦擦* 提交于 2019-12-06 07:22:46
In my ASP.NET Web Forms application I am using ASP.NET Identity 2.2 for the membership system. The Development stage works as expected. Users get authenticated and have access to different areas of the website according to their roles. After the deployment to the IIS 10 local server the authentication is overturned. The login is successful and, yet, the user does not authenticate. The Login page loads once again empty and fresh. I know that the login is successful through some test I've made with a literal created right before the redirect. This is the Login method: protected void LogIn(object

Autofac WebApi 2 OWIN Not Working

╄→гoц情女王★ 提交于 2019-12-06 06:10:10
Having an issue with Autofac and WebApi2 using OWIN. Basically the Constructor isn't getting Injected. public class Startup { public void Configuration(IAppBuilder app) { var config = new HttpConfiguration(); config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "Default Route", routeTemplate: "{controller}.{ext}" ); config.Routes.MapHttpRoute( name: "Default Route with Id", routeTemplate: "{controller}/{id}.{ext}", defaults: new { id = RouteParameter.Optional } ); var builder = new ContainerBuilder(); builder.RegisterApiControllers(Assembly.GetExecutingAssembly()); builder

UserManager dependency injection with Owin and Simple Injector

↘锁芯ラ 提交于 2019-12-06 05:42:12
After adding Simple Injector to my project to create an instance of my UserAppManager that will exist through the whole lifetime of a session I started to recieve errors: Error with no parameterless constructor: An error occurred when trying to create a controller of type 'AuthController'. Make sure that the controller has a parameterless public constructor. Error with a parameterless constructor: For the container to be able to create AuthController it should have only one public constructor: it has 2. I followed a guide ( https://simpleinjector.codeplex.com/discussions/564822 ) to avoid

How to Deploy Owin Self Hosted Application In Production?

夙愿已清 提交于 2019-12-06 04:28:32
问题 I have an Asp.Net Owin Self Hosted WebApi application. The application can be installed as a windows service in production environment. Currently I'm running and accessing the service via url http://localhost:8000 successfully. Now I want to map the service to a domain to access it from public network. I have a registered domain and have control over it. Ex: www.myservice.com How can I point the domain to WebApi service for a Self Hosted Application? 回答1: In order to allow public access to