OWIN Middleware in the IIS integrated pipeline
Questions tagged [owin-middleware]
266 questions
1
vote
2 answers
How to authenticate in WebAPI using OAuth bearer calling style in WS-Federation?
Is there an out of the box extension for Ws-Federation authentication in OWIN middleware libraries to handle Web APIs using authentication header instead of cookies?
// OAuth bearer calling style
var headers = {};
headers.Authorization = 'Bearer '…

Homam
- 23,263
- 32
- 111
- 187
1
vote
1 answer
ASP.NET Core RC1 MVC 6 - How to access UrlHelper From Middleware and create Url to Action
I'm trying to redirect 301 a legacy URL using a middleware.
private static Boolean IsLegacyPathToPost(this HttpContext context)
{
return context.IsLegacyPath() && context.Request.Path.Value.Contains("/archives/");
}
public static void…

Alexandre Nourissier
- 338
- 2
- 13
1
vote
2 answers
CORS issue when adding log4net config
Context:
I have a simple Web API project with a controller and an action.
In the header of each request, I add an authorization token.
Everything work as expected. I can request a token based on some credentials, and use it to make HTTP requests…

Radu Cojocari
- 1,759
- 1
- 22
- 25
1
vote
1 answer
ASP.Net MVC: How to handle session start and end by owin middle ware
this is sample code for session start and end.
public void Session_OnStart()
{
Application.Lock();
Application["UsersOnline"] = (int)Application["UsersOnline"] + 1;
Application.UnLock();
}
public void Session_OnEnd()
{
Application.Lock();
…

Mou
- 15,673
- 43
- 156
- 275
1
vote
2 answers
Owin.TestServer To Test a Middleware that Requires Authentication
I have a middleware method that requires context.Authentication.User.Identity.Name to be resolved for proper execution. However, when writing a unit test these properties are obviously null as no sign-in has occurred. I am not using Oauth or…

Shawn
- 869
- 1
- 9
- 27
1
vote
1 answer
OWIN Middleware: find if the request has a matched route
We would like to write a piece of OWIN middleware that looks at the current request and see if it matches any mapped routes (we are using web.api, so we register routes with the httpRouteCollection.MapHttpRoute method.
If the current request does…

Aran Mulholland
- 23,555
- 29
- 141
- 228
1
vote
1 answer
What is the role of the cookie middleware in SPA Template
The VS 2013 SPA Template is configured with the cookie middleware, among other middlewares like the OAuth MW or ExternalCookie MW.
// Enable the application to use a cookie to store information for the signed in user
…

tstojecki
- 1,480
- 2
- 19
- 29
1
vote
1 answer
Debugging Self Host OWIN Middleware does not always run
I have a simple console app to learn OWIN/Katana and I am stuck.
class Program
{
static void Main(string[] args)
{
string url = ConfigurationManager.AppSettings["url"];
using (var app = WebApp.Start(url))
{
…

jjhayter
- 352
- 4
- 19
1
vote
3 answers
Exception when OWIN Middleware AuthenticationHandler AuthenticateCoreAsync returns null
I am try to write a custom Owin Authentication Middleware. I am currently only writing a dummy one even simpler than this.
According to this and other tutorials, it seems I could return null in AuthenticateCoreAsync of my DummyAuthenticationHandler…

Morio
- 8,463
- 5
- 25
- 29
0
votes
0 answers
Linkedin login through owin.security.OpenIdConnect in .net4.7.2 and MVC5 based webapplicaiton
Currently I am working on a website developed using .Net 4.7.2 and MVC5. Received a requirement to implement Linkedin authentication using "OpenIdConnectAuthentication" from owin.security.OpenIdConnect.
I have added below code in my startup.cs
…

Thavudu
- 235
- 3
- 13
0
votes
0 answers
How to integrate owin with classic asp project
I have updated classic asp project to .net 4.8 version without restructuring or any code changes and added owin integration for the same. but I am not able to set cookies for the project. I am getting HTTP/1.1 New Application Failed after owin…

shweta
- 1
- 1
0
votes
0 answers
IDX20803: Unable to obtain configuration and IDX20804: Unable to retrieve document for openID Connect
Trying to implement single sign On using oauth 2.0 and openIDConnect in ASP.NET web form Application. I have all the credential. My authority address i am browsing and returning JSON Data. But, from my code it's showing Error.What is the issue in my…
0
votes
0 answers
Problem oauth Google Login in Identity server 3 MVC
im currently working on incoroporate Google Login on Identity Server 3. Im using Microsoft.Owin.Security.Google but im struggling on what button do i have to put on my html to use google login. My code in my StartupClass is the following:`
public…
0
votes
0 answers
asp.net mvc 4 skip middleware if there is no [Authorize] attribute present
I have a middleware that should only be applied in the presence of [Authorize] attribute. I need to be able to do something like
if( !authorizeIsPresent ) {
Next.Invoke(context); // Skip this middleware
}
else {
Do normal stuff when…

lclankyo
- 221
- 3
- 10
0
votes
0 answers
AllowAnonymous with .NET MVC and OWIN context
I have .NET MVC application with OWIN Middleware.
The issue I'm facing right now is I'm not able by pass middleware logic for AllowAnonymous.
By default all the requests are forwarded to Middleware and I've to bypass some of the public requests from…

Bharat
- 5,869
- 4
- 38
- 58