owin

What URL does OWIN understand for ipv6 self-hosting?

放肆的年华 提交于 2019-12-05 01:41:43
My application uses self-hosting feature of ASP.NET Web API . NuGet package name I use is Microsoft.AspNet.WebApi.SelfHost. I used following example as a base. Following code works for me to launch host on ipv4 localhost endpoint: WebApp.Start<Startup>("http://127.0.0.1:43666"); What do I enter if I want to specify ipv6 address? "http://[::1]:43666" does not work. Exception thrown is [reformatted]: System.Net.HttpListenerException: The network location cannot be reached. For information ..about network troubleshooting, see Windows Help at System.Net.HttpListener.AddAllPrefixes() at System.Net

asp.net web api self hosting / owin / katana

徘徊边缘 提交于 2019-12-05 01:34:39
There are multiple question I have around self-hosting Self Hosting Nuget There are 2 nuget which provide self hosting : Microsoft.AspNet.WebApi.OwinSelfHost and Microsoft.AspNet.WebApi.SelfHost , so does microsoft have 2 implementation of self hosting?? or they are same?? Owin or Kitana the name of nuget is Microsoft.AspNet.WebApi.OwinSelfHost has OWIN, but as far as I read Owin is an interface and Kitana an implementation, what is the name of the nuget for implementation?? Hosting in Production I have managed to run the example by creating a console. But when deploying to prod, how to deploy

OWIN cannot run multiple apps in isolation using webapp.start

て烟熏妆下的殇ゞ 提交于 2019-12-05 01:20:33
问题 When I try and start two apps on different url's, I get problems with attribute routing middleware. If I have two similar routes in seperate apps but with different http methods web.api seems find only one of the methods. Microsoft.Owin.Hosting.WebApp.Start<Admin.Startup>("http://localhost:1000"); Microsoft.Owin.Hosting.WebApp.Start<Startup>("http://localhost:1001"); How can I isolate both apps so that attribute routing don't conflict? 回答1: Based on your last comment, an example below to

SSO with AD FS and OWIN how to create an account and handle permissions

╄→гoц情女王★ 提交于 2019-12-05 00:54:29
问题 I configure a Web App that use AD FS, for this I use OWIN. For the login, all is ok. If i'm an user of a domain and go to the website, he is automatically connected. But what I want to have is to handle users and roles by myself after login. So I want to check that an user exists in my database with this AD account (this process will be make before the login in another application) I want to use Identity from Microsoft to handle claims (roles and permissions). But I don't understand how to

Facebook OAuth stopped working suddenly

这一生的挚爱 提交于 2019-12-05 00:07:31
I noticed yesterday that my Facebook login for my website has stopped working. This has been working great for the last 2 months, as far as I am aware I have not changed anything. I have tried everything I can on links such as: - as well as many more... ASP.NET MVC5 OWIN Facebook authentication suddenly not working I have noticed that the Stack Overflow Facebook auth has also stopped working. Has anyone else noticed this and found any solution? It's worth noting I am using azure app services to host. But this issue is also found when I am using localhost. My current setup looks like this... in

WebAPi - unify error messages format from ApiController and OAuthAuthorizationServerProvider

可紊 提交于 2019-12-04 23:49:25
In my WebAPI project I'm using Owin.Security.OAuth to add JWT authentication. Inside GrantResourceOwnerCredentials of my OAuthProvider I'm setting errors using below line: context.SetError("invalid_grant", "Account locked."); this is returned to client as: { "error": "invalid_grant", "error_description": "Account locked." } after user gets authenticated and he tries to do "normal" request to one of my controllers he gets below response when model is invalid (using FluentValidation): { "message": "The request is invalid.", "modelState": { "client.Email": [ "Email is not valid." ], "client

How to set Claims from ASP.Net OpenID Connect OWIN components?

送分小仙女□ 提交于 2019-12-04 23:24:49
I have questions upon using the new ASP.Net OpenID Connect framework while adding new Claims during the authentication pipeline as shown in the code below. I'm not sure just how much 'magic' is happening behind the scenes. I think most of my questions center around not knowing much about OWIN authentication middleware as opposed to OpenID Connect. Q1. Should I be manually setting HttpContext.Current.User and Thread.CurrentPrincipal from OwinContext.Authentication.User ? Q2. I want the ability to add object types to claims like I used to with System.IdentityModel.Claims.Claim . The new System

Authenticating requests to Microsoft.Owin.Testing.TestServer

。_饼干妹妹 提交于 2019-12-04 23:24:06
I'm using the owin TestServer class to unit test my web api. It's working great except that I'm unsure how to authenticate requests, so I can't really test endpoints that require authentication, other than to make sure that unauthenticated requests are unauthorized. I am configuring WebApi to use only bearer token authentication as indicated here: // Web API configuration and services // Configure Web API to use only bearer token authentication. config.SuppressDefaultHostAuthentication(); config.Filters.Add(new HostAuthenticationFilter(OAuthDefaults.AuthenticationType)); Any ideas how I could

How to inspect MVC response stream using OWIN middleware component?

こ雲淡風輕ζ 提交于 2019-12-04 23:08:30
问题 This question has been asked before in a few forms but I cannot get any of the answers to work, I'm losing my hair and unsure if the problem is just that the solutions were from 2 years ago and things have changed. How can I safely intercept the Response stream in a custom Owin Middleware - I based my code on this, it looks like it should work, but it doesn't OWIN OnSendingHeaders Callback - Reading Response Body - seems to be a different OWIN version, because method signature doesn't work

GetExternalLoginInfoAsync null with OWIN in ExternalLoginCallback unless already logged into google

瘦欲@ 提交于 2019-12-04 22:42:30
问题 I've been trying to implement external logins with OWIN in an MVC5 app using a google account. If I'm already logged into google, clicking the google button in my app is fine and it takes me to my registration page after allowing me access to the logininfo. If I'm not already logged into google when I click my applications google button, I get prompted to login with Google as expected but the call back receiver doesn't seem to see that I've logged in as logininfo is always null in this