owin

Microsoft.Owin.Host.SystemWeb and still getting No owin.Environment item was found in the context

為{幸葍}努か 提交于 2019-12-19 05:46:16
问题 I've read lots of posts on this but still can't get this to work. I'm using Visual Studio 2013. I created a new MVC 5 Project and thought it would be cool to use the new facebook login integration. It works fine on my PC in IIS Express. But when I upload it to the Production server I keep getting the very annoying "No owin.Environment item was found in the context" message. Here's what I've done. I never changed the name of my project or assembly. The assembly name is Wodivate The namespace

AuthenticationManager.GetExternalLoginInfoAsync() on google aspnet mvc5 returns null

橙三吉。 提交于 2019-12-19 03:12:35
问题 I've developed an ASPNET MVC 5 application using default Visual Studio 2015 Template and Google authentication. All works fine in the development environment but on real the call after external authentication AuthenticationManager.GetExternalLoginInfoAsync() sometimes returns null. Normally it returns null on the central hours of the day (from 08:00 to 20:00) but I haven't found a pattern because sometimes works at that time. I've watched the developer console, but there are not a lot of

Does OWin support WCF?

a 夏天 提交于 2019-12-19 01:14:04
问题 I have a c# project that exposes services via WebApi and also via WCF. It works under IIS. Now I need to offer it as self host solution. I cannot find documentation about Owin and how to expose WCF services. Does OWin support WCF? 回答1: I think the question should be the other way around. Does WCF support OWIN? As I understand, OWIN offers the infrastructure needed to abstract away the web server. However, whatever framework you want to use on it must have an OWIN implementation, which I think

SignalR, Owin and exception handling

泄露秘密 提交于 2019-12-18 19:03:06
问题 I've developed a sample SignalR application based on ASP.NET 4.5 & Owin, and I've hosted that app on IIS 7.5. Everything is working fine, but how can I handle exceptions in Owin? Consider the following code: [HubName("SampleHub")] public class SampleHub : Hub { public SampleHub() { throw new InvalidOperationException("?!"); } } This exception won't call Application_Error (and this is my problem). Where can I get all exceptions from Owin for logging and debugging purposes similarly to

How is Owin able to set the Asp.Net Identity authentication cookies after the Application_EndRequest stage?

六月ゝ 毕业季﹏ 提交于 2019-12-18 16:17:40
问题 As a test, I created a fresh Asp.Net MVC5 app using the latest template in Visual Studio 2013. I added the following method to Global.asax.cs: protected void Application_PreSendRequestHeaders() { Response.AppendCookie(new HttpCookie("TotalNumberOfCookiesInApplication_EndRequestIs", Response.Cookies.Count + string.Empty)); } When I start the app and do a POST to /Account/Login using the credentials of a registered user, the cookies that get returned to the client are: Note that the custom

When implementing your own IUserStore, are the “optional” interfaces on the class actually optional?

故事扮演 提交于 2019-12-18 13:12:46
问题 I'm working with Microsoft's Asp.Net Identity framework version 2, and am implementing my own IUserStore. My new class MyUserStore implements the IUserStore<MyUserClass,int> interface and the IUserPasswordStore<MyUserClass,int> , which is what is required to use it with the UserManager<MyUserClass,int> class. Or at least that's what I gathered from reading tutorials like this: "The one required interface in the identity system is IUserStore" - Scott Allen But this doesn't seem to be the case

Owin, pass custom query parameters in Authentication Request

霸气de小男生 提交于 2019-12-18 11:48:42
问题 We have our own OpenID Connect Provider. We want to pass custom query parameter in Authentication request using Owin middleware. And we cannot find the way how to implement this using Microsoft.Owin.Security.OpenIdConnect assembly. Even We cannot find how to add a standard request parameter to Authentication Request (e.g. " login_hint parameter"). For example Google has " login_hint " and " hd " parameters (https://developers.google.com/accounts/docs/OAuth2Login#sendauthrequest), and we want

Change OWIN Auth Middleware Per Request (Multi-tenant, oauth API keys per tenant)

限于喜欢 提交于 2019-12-18 11:13:11
问题 I have a multi-tenant application. Each tenant can authenticate its users using OAUTH-2 with Facebook, Twitter, Google, etc. Each tenant has its own API keys for the aforementioned services. The typical way to setup the OWIN pipeline is to "use" auth providers in Startup but this sets the API keys at app start. I need to be able to change which keys are used with each oauth API for each request. app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType =

SignalR MVC 5 Websocket no valid Credentials

為{幸葍}努か 提交于 2019-12-18 11:01:40
问题 i try to use SignalR in MVC Application. It works well but i get the following Error in the Chrome console WebSocket connection to 'ws://localhost:18245/signalr/connect?transport=webSockets&clientProtocol=1.4&connectionToken=bNDGLnbSQThqY%2FSjo1bt 8%2FL45Xs22BDs2VcY8O7HIkJdDaUJ4ftIc54av%2BELjr27ekHUiTYWgFMfG6o7RaZwhf fpXavzWQ1jvkaxGm5rI%2BWtK7j0g1eQC2aOYP366WmRQLXCiYJfsm4EbwX6T8n2Aw %3D%3D&connectionData=%5B%7B%22name%22%3A%22importerhub% 22%7D%5D&tid=9' failed: HTTP Authentication failed; no

Is there Application_End from Global.asax in Owin?

為{幸葍}努か 提交于 2019-12-18 10:48:41
问题 Startup.cs is a new way to initialize your app instead of Application_Start in Global.asax and it's fine. But is there a place to put my teardown logic, for example this: public class WebApiApplication : System.Web.HttpApplication { protected void Application_End() { // Release you ServiceBroker listener SqlDependency.Stop(connString); } } Looked in Microsoft.Owin namespace but it only seems to have OwinStartupAttribute . Does this mean that application lifecycle events are still processed by