owin

NullReferenceException experienced with Owin on Startup .Net Core 2.0 - Settings?

十年热恋 提交于 2019-12-10 11:19:59
问题 I'm trying to start up a WebApp to use with NancyFx in a .NET Core 2.0 project. The package i've added to the solution to do this is Microsoft.AspNet.WebApi.OwinSelfHost which installs it's dependencies: Microsoft.AspNet.WebApi.Client Microsoft.AspNet.WebApi.Core Microsoft.AspNet.WebApi.Owin Microsoft.Owin Microsoft.Owin.Host.HttpListener Microsoft.Owin.Hosting Newtonsoft.Json Owin I've also added: Nancy Nancy.Owin My project is of type "xUnit Test Project (.NET Core)". Starting with my test

UserManager dependency injection with Owin and Simple Injector

隐身守侯 提交于 2019-12-10 10:58:42
问题 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

Incremental Google OAuth with Asp.Net Owin Oauth

末鹿安然 提交于 2019-12-10 10:39:12
问题 I'm looking for a solution to doing incremental authorization against Google's api's with Asp.Net's Owin OAuth Libraries. I know how to set scope for specific api's, but I would like to do it incrementally and can only see how to set it on globally. Doc on Google Oauth Incremental Auth... https://developers.google.com/accounts/docs/OAuth2WebServer#incrementalAuth Current VB Code... Public Sub ConfigureAuth(app As IAppBuilder) Dim googleCreds = New GoogleOAuth2AuthenticationOptions() With {

Autofac WebApi 2 OWIN Not Working

戏子无情 提交于 2019-12-10 10:37:25
问题 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 =

Facebook v2.4 with OAuth2 stopped working and only getting name and id

帅比萌擦擦* 提交于 2019-12-10 10:24:58
问题 Something changed from facebook APIs v2.3 to v2.4 - after using 2.4 I can only get name and id, I saw some posts talking about adding a "?fields=scopes..." but it's a true mystery for me - I'm trying to understand how to send these scope fields... Here is my code: var facebookAuthOptions = new FacebookAuthenticationOptions(); facebookAuthOptions.AppId = facebookAuthAppId; facebookAuthOptions.AppSecret = facebookAuthAppSecret; facebookAuthOptions.Scope.Add("email"); facebookAuthOptions.Scope

Azure ADAL Refresh id_token

左心房为你撑大大i 提交于 2019-12-10 09:14:24
问题 We are developing a multi-tenant web application. Our tenants will be using Windows Azure Active Directory for authentication. We are using OWIN OpenIdConnect middleware to authenticate users. The response we receive after authentication process has id_token and authorization code. We also want to get the refresh token so that we can acquire new tokens once the id_token expires. Therefore in AuthorizationCodeReceived handler we use AcquireTokenByAuthorizationCode method in ADAL library to

Unable to Access Owin Self hosted RestApi - Deployed to AWS EC2 - Windows 2012 R2

丶灬走出姿态 提交于 2019-12-10 08:49:03
问题 Following is the sample self hosting RestApi code, i have created with OWIN. It is working in my local machine. i have hosted it in aws-ec2, and started as administrator. I am able to access the RestApi from inside the instance (using chrome/IE) giving localhost as url. But getting a Bad request invalid hostname, when i replace the localhost with public DNS of Instance (running within Instance's browser). when i tried to access the RestApi from outside the instance browser from my local

OWIN interferes with log4net

删除回忆录丶 提交于 2019-12-10 06:44:21
问题 In my application, I've got the following logging strategy/appenders: DebugAppender : If the root level is DEBUG, write every message that matches DEBUG to the default trace listener output ConsoleAppender : If the application mode (global context property) is 'console', write every message above WARN to the console ouput EventLogAppender : If the application mode (global context property) is 'service', write every message above ERRROR to the console output RollingFileAppender : Write every

ASP.NET Web API - OWIN - TokenEndPointPath not working in IIS

一笑奈何 提交于 2019-12-10 05:43:38
问题 I have the following code in my startup.cs. Setting up the TokenEndpointPath works perfectly in IIS Express and when the Web API project is deployed to the root of a website in IIS. However, if I host in a nested application (i.e. an application within a website) in IIS calls to the token endpoint result in a 404. Is there a way to base the TokenEndpointPath off of the actual IIS structure instead of the root, as it does here? Right now: This Works http://server:80/api/token This does not

Authorization with ASP.NET Identity & Autofac OWIN integration

爷,独闯天下 提交于 2019-12-10 05:02:24
问题 (an update has been added at the bottom of this question) I have a web application that uses both MVC5 and WebAPI2 with Autofac for DI. The app uses ASP.NET Identity and oAuth bearer tokens, though the latter may be beside the point. This has all worked perfectly well, but at this point I need the same instances of my injected services to be shared throughout the OWIN pipeline as well as the rest of my application and therefore I'm trying to setup Autofac's OWIN integrations for MVC and Web