owin

Is there a simple way to implement Single Sign On across domains in MVC5 [duplicate]

你。 提交于 2019-12-24 15:18:33
问题 This question already has answers here : ASP.NET Identity Cookie across subdomains (4 answers) Closed 4 years ago . Scenario: Two separate web projects, running om these domains: account.ilovepandas.com ilovepandas.com Using ASP.Net Identity, is there a simple way in MVC5 to implement a shared login, so that if the user is logged in to ilovepandas.com and goes to account.ilovepandas.com, he will already be authenticated? I have done research on the topic, and there are some quite complicated

OWIN not firing up if project not set as Startup with IIS Express

≡放荡痞女 提交于 2019-12-24 14:19:18
问题 I have a solution in VS2013 with the following setup: App.Web (Web Project with only static files) App.Web.API (Web API project with OWIN) Both the projects have a default url pointing to their own localhost:portX (I am using IIS Express), so App.Web is listening on localhost:2222 and APP.Web.API is listening on localhost:3333. I set up the App.Web.API to use OWIN and I added the package Microsoft.Owin.Host.SystemWeb for the autofire up in IIS. I put a breakpoint in the configuration method

How to authenticate from Web API controller endpoint when implementing Identity 2.1 + OWIN OAuth JWT bearer token

痴心易碎 提交于 2019-12-24 12:45:37
问题 I'm unable to authenticate from within my controller method, as part of my confirm-user-signup workflow and I'm looking for some guidance that my implementation is correct. My controller method has the following code; I've confirmed that the user is populated (as part of the FindById call) but after SignIn ; this.Authentication.User.Identity is not set ( Name is blank and IsAuthenticated is false): this.Authentication.SignOut("JWT"); ApplicationUser user = await this.AppUserManager

OData query in swagger ui

ⅰ亾dé卋堺 提交于 2019-12-24 11:27:26
问题 I was checking out the following tutorial: http://blogs.msdn.com/b/martinkearn/archive/2015/03/10/using-odata-query-syntax-with-web-api.aspx And I was curious if there was support in swagger ui somehow to show the query parameters. Essentially I wanted all calls tagged with [EnableQueryAttribute] attribute to have swagger ui for inputting query parameters and I don't want to add these parameters to the method call I still want them to be in the URL and pulled out for the Owin context. Any

Identity server - bearer token authentication - how to trace failed authorization?

血红的双手。 提交于 2019-12-24 11:00:03
问题 I have set up a simple identity server on my development environment, configured as so: public void Configuration(IAppBuilder app) { Log.Logger = new LoggerConfiguration() .MinimumLevel.Verbose() .WriteTo.Trace() .CreateLogger(); app.Map("/identity", id => { id.UseIdentityServer(new IdentityServerOptions() { SiteName = "Tomas Services Identity Provider", SigningCertificate = CertificateService.Load(), Factory = IdentityFactory.Configure("IdServerConn"), RequireSsl = false }); }); } The

Call a SignalR method from a different AppDomain

别等时光非礼了梦想. 提交于 2019-12-24 10:34:33
问题 I have a working web server written in C# using SignalR. It's a self-hosted Owin Application. Everything works fine. Now I have to relocate my controllers in different AppDomains. This breaks the SignalR part, because GlobalHost remains the same only within one AppDomain, and is not serializable (thus I can't pass it along to other AppDomains as it is). I've found a lot of examples/questions/tutorials about calling SignalR hubs methods from a Controller/an other class/whatever, but nothing

asp.net Web API most efficient way to replace a request response body to have a consistant error structure

不问归期 提交于 2019-12-24 09:16:44
问题 I am using as Web API what uses AuthorisationManager owin middleware to handle token based security. My problem is that various errors within the response body have various different formats. Within my api, I usually send errors back with the structure {"code": "error code", "message": "error message"} However some of the errors coming from the security may use {"error": "error code", "error_description": "error message"} or sometimes just {"error": "error mesage"} I would like to unify these

Why is my microsoft.owin.security.authenticationmanager Signin method not working?

旧时模样 提交于 2019-12-24 08:52:44
问题 I working on an ASP MVC login form. I have pretty simple codes. A Startup class and an action trying to set the cookie. Below is my code : Startup which is located in App_Start (there is also a reference to it in <appSetting> with key="owin:AppStartup" ) public class Startup { public void Configuration(IAppBuilder app) { app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = "ApplicationCookie", LoginPath = new PathString("/auth/login"), }); } } The action method

Issue when using IAppBuilder.UseWebApi

最后都变了- 提交于 2019-12-24 08:32:51
问题 I am creating a SPA (Singe Page Application) using WebApis in ASP .NET MVC5. For WebAPis I am using attribute routing. For requests other than Web API, I have configured a Catch-All route that maps to Home controller and Index action Here is my code I have the following configuration code in my StartUp.cs file using System.Web.Routing; [assembly: OwinStartup(typeof(MyApp.Startup))] namespace MyApp { public class Startup { public void Configuration(IAppBuilder app) { GlobalConfiguration

ASP.NET MVC Not logged in after successfully signed in

你说的曾经没有我的故事 提交于 2019-12-24 07:41:14
问题 In my own machine and browser (chrome), I am not able to login in my website. It works in other browsers, with other users of chrome and in incognito window. It also works in my development environment or in other stages of the same website. My relevant code regarding login is the following: => StartUp.ConfigureAuth app.UseCookieAuthentication(new CookieAuthenticationOptions { AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie, LoginPath = new PathString("/Account/Login"),