OWIN Middleware in the IIS integrated pipeline
Questions tagged [owin-middleware]
266 questions
2
votes
2 answers
Use ASP.NET Core WEB API token authentication as a resourceserver with OWIN/Katana OAuth 2.0 Authorization Server
Is it possible to use an ASP.NET Core web api service authentication with an OWIN/Katana OAuth 2.0 Authorization Server?
To use the default (Bearer) OAUTH2 access token in ASP.NET 4.5.x WEB API 2 this would be done by adding this:
public void…

Wouter Crooy
- 111
- 1
- 7
2
votes
2 answers
Change OWIN Request.Body in middleware
I want to implement custom encryption middleware for API calls. At first, I read request body (IOwinContext.Request.Body) and headers (Encryption-Key & Signature). Then, I decrypt request body, which gives me pure json string. Now comes the tricky…

MatusMak
- 560
- 4
- 20
2
votes
0 answers
How do i register UserManager with OWIN context?
When I create MVC 5 application in Visual Studio 2013, and choose Individual accounts as authentication then scaffolding automatically configures ASP Net Identity. It creates several classes along with ApplicationDbContext and…

LP13
- 30,567
- 53
- 217
- 400
2
votes
3 answers
FileServerMiddleware with credentials?
We have the requirement in our enterprise environment to serve static file content from a network share in our ASP.NET Core application. Basically, it gets served under some sub path /content. For this, we have the following code, which works…

Matthias
- 3,403
- 8
- 37
- 50
2
votes
1 answer
DotNetOpenAuth rejecting Access Token requests when redirect_uri contains querystring parameters
I'm developing an OAuth v2 Authorization Server using the OWIN middleware and I'm trying to implement the OAuth2 Authorization Code Grant Flow but I'm running into an issue where my client is receiving errors if the redirect_uri contains querystring…

MyItchyChin
- 13,733
- 1
- 24
- 44
2
votes
1 answer
Can't overwrite Response Body with Custom Message within ValidateIdentity in OAuthBearerAuthenticationProvider class
I try to set a custom error message to return from "ValidateIdentity" Code from my OAuthBearerAuthenticationProvider. But All I get back is
{"message":"Authorization has been denied for this request."}
This is my Code:
internal class…

rudimenter
- 3,242
- 4
- 33
- 46
2
votes
2 answers
Get Access Token Asp.NET Web Api 2
I'm having trouble problem with web api 2.
I'm using vs2015 and have developed my project on asp.net mvc single page template that use knockout and sammy to get/authorize identity through owin middleware.
When I request for access token via…

tsubasaetkisi
- 301
- 2
- 10
2
votes
1 answer
Exception handling in OWIN Middlware
I am trying to add some middleware so that any unhandled exceptions I catch and log it but experiencing some difficulties in doing so. Not been able to find a lot on this and for some odd reason my code doesn't seem to be entering the catch block.…

Dr Schizo
- 4,045
- 7
- 38
- 77
2
votes
1 answer
What does GenerateCorrelationId() and ValidateCorrelationId() do?
I see this code within a custom owin handler to do Oauth2. For example here: https://github.com/RockstarLabs/OwinOAuthProviders/blob/master/Owin.Security.Providers/Reddit/RedditAuthenticationHandler.cs
Can someone explain to me in plain English…

seescode
- 2,101
- 15
- 31
2
votes
2 answers
ASP .NET 5 (MVC6) External Forms Authentication
I'm currently investigating an elegant solution to this problem, but I wanted to get this question out here in order to get any advice/suggestions/answers to this problem.
I am working with an authentication system (forms authentication) that the…

Patrick Smith
- 261
- 1
- 6
2
votes
1 answer
OWIN cookie based authentication middleware can't change cookie name
I am trying to rename the authentication cookie by doing the following:
app.UseCookieAuthentication(new CookieAuthenticationOptions
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new…

tribus
- 1,110
- 1
- 9
- 27
2
votes
1 answer
Why is owin middleware created a second time after the HttpRequest ended
After a question as per why the ApplicationDbContext from Asp.Net Identity is created and disposed twice per Request I did some research why this would happen. I found that the ApplicationDbContext is actualy created once per HttpRequest but when…

Ric .Net
- 5,540
- 1
- 20
- 39
2
votes
1 answer
OWIN Authentication
I have an Azure WebRole (MVC app) and Azure Worker role.
Now, I have my SignalR hubs hosted in the Worker Role using Owin.SelfHost.
The MVC app need to call this hubs in the worker role - which is quite straightforward.
Now my problem is…

Linc Abela
- 797
- 2
- 12
- 26
2
votes
1 answer
OWIN Middleware's CurrentPrincipal.Identities have different claims set
Today I was configuring authorization provider for Oauth middleware and trying to insert some guid value into Thread.CurrentPrincipal.Identity.Claims. But when I tried to call Thread.CurrentPrincipal's FindFirst I've got nothing.
Here is the example…

Refraction
- 183
- 1
- 12
1
vote
0 answers
What's the Owin middleware alternate in WCF?
I am trying to implement multitenancy in a WCF application but facing some issues.
So I already have Autofac configured in the app and Autofac also supports multitenancy with WCF
Now my scenario is little different. I have a mobile app that's…

Ask
- 3,076
- 6
- 30
- 63