owin

Get URL information in Startup

馋奶兔 提交于 2019-12-12 03:07:36
问题 In an asp.net MVC 5 project I'm using a katana owin based middlewere to handle the authentication. Inside the Start.cs file I have the Startup class with the Configuration method. Is there a way to get the full URL of the request inside the Configuration method? I need to get the last part of it to be stored in a cookie public void Configuration(IAppBuilder app) { app.UseCookieAuthentication(new CookieAuthenticationOptions { ... } // something here to get the full URL // other authentication

OWIN: IIS throws Access denied for authenticated user while accessing child application

自古美人都是妖i 提交于 2019-12-12 02:57:49
问题 Background I have web forms application that use OWIN + Azure AD for authentication. The application is hosted in IIS 10.0.10586.0. The application is hosted at root ( Default Web Site) as www.mydomain.com . I also have child .net application (not virtual directory) which contains some static pages and some .Net code. So authenticated user can access static pages as www.mydomain.com/pages/page1.html Steps I followed: 1> Create web form application and implanted Azure AD authentication using

Token Based Authentication using ASP.NET Web API 2 and Owin throws 401 unauthorized

喜你入骨 提交于 2019-12-12 02:43:37
问题 I have create a OAuth Authentication using the guide from Taiseer Joudeh. I have created an endpoint /token to make the authentication. It works and I receive a result like this. { "access_token": "dhBvPjsHUoIs6k8NDsXfROpTq63qlww_7Bifl0LOzIxhZnngld0QCU-x4q4Qa7xWhhIQeQbbK6gYu_hLIYfUbsFMsdXwqlOqAYabJHNNsnJPMMHNADb-KCQznPQy7-waaqKMCVH1HPqx4L30sXlX0L8MbjtrtkX9-jxHaWdPapqYA9lU4Ai2-Z5-zXxoriFDL-SvxrUnBTDQMnRxOH_oEyclUngzW-is543TtJ0bysQ", "token_type": "bearer", "expires_in": 86399 } But if I use

SignalR and SelfHosting ASPNet app

冷暖自知 提交于 2019-12-12 02:42:50
问题 I have an ASPnet webapplication that uses SignalR, it works fine under IIS. When I try to self host the ASP.NET webapplication with System.Web.ApplicationHost.CreateApplicationHost, The signalR functionality is gone. From debugging, I see that the OWin Startup class is never hit. Does anyone have a clue why? From what I understand, the CreateApplicationHost is just hosting the application outside of IIS, but it still runs through the ASP.NET pipeline, So, I don't understand why Owin startup

How to perform Sign-in with IdentityServer3?

泪湿孤枕 提交于 2019-12-12 02:27:42
问题 I am developing a web api for use with IdentityServer3. I have the server and the web api running, but I am having trouble figuring out how to have users login from a mobile app to the server. My question is this: if I have implicit flow enabled for the identity server, how do users sign in from a tool like fiddler to receive their tokens upon successful authentication? I know that the token endpoint is: https://myidservername/identity/connect/token I also know that the authorization endpoing

AngularJS - Authentication with Bearer Token and Web API 2.0

烈酒焚心 提交于 2019-12-12 02:02:21
问题 I have the problem that even though I set the $http.defaults.headers.common.Authorization to null I am still capable of accessing the [Authorize] part of my Web API 2.0 application. This problem doesn't arise when I start the application from scratch and try to retrieve the data via an initial GET request. This is when I get an error from the $http callback function. Any guesses why this is happening? I am quite confident that the bearer token is stored somewhere in the browser and doesn't

validate Oauth Bearer Token in Resource Server

别来无恙 提交于 2019-12-12 01:56:21
问题 I am trying to write my own oauth authentication server with oauthAuthorizationServerProvider . The client requests the Authserver for token. If client credentials are valid auth server with give a access token. now the client send the token with every request to the resource sever. i am unable to understand how the resource server will validate the token which was generated by the auth server. can anybody give any example code using oauthAuthorizationServerProvider . Below is the

Using CefSharp with Owin TestServer

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 01:41:26
问题 Due to potential firewall limitations and the need to have many instances of my app that cannot be competing for ports, I would like to use the Microsoft.Owin.Testing.TestServer class to create an in-memory web server that will serve requests to an embedded CefSharp browser (either WPF or Winforms is fine). I can create the TestServer with no issues. How can I configure the CefSharp WebBrowser control to use that Test Server rather than using the standard OS network stack? If I was forming my

Autofac Injection of data into OWIN Startup class

非 Y 不嫁゛ 提交于 2019-12-11 23:25:59
问题 I've been looking around on SO for a while and can't find the answer to my particular question: How do you use Autofac to inject data (via constructor or property) into the OWIN Startup class? I'm using Autofac in a Windows service which also handles creation of back-end services etc. so I'm doing all the configuration reading and container building in there. I want to be able to register the Startup class so I can inject allowed origins for CORS but even when I register the object with a

OWIN Startup Class

╄→尐↘猪︶ㄣ 提交于 2019-12-11 22:13:24
问题 Can someone please tell me the exact role of the OWIN startup class. Basically what I am looking for : Whats its purpose When is it called, it is just once or per request Is this a good place to configure my Dependency Injection library. 回答1: Owin is designed to be pluggable deisgn. there are a set of services which you can change/replace from the configuration. For example in the following configuration, i have enabled webapi Enabled Signalr Enabled Attribute Based routing for Signalr