OWIN Middleware in the IIS integrated pipeline
Questions tagged [owin-middleware]
266 questions
3
votes
1 answer
Dynamically change Owin configuration values
I am using Owin pipeline and in startup.auth.cs setting the application cookie interval as below
timeout=Convert.ToDouble(ConfigurationManager.AppSettings["SessionTimeOut"]);
// Owin Middleware3 - Cookie Authentication Middleware
…

VVR147493
- 251
- 2
- 4
- 16
3
votes
1 answer
Authenticating a particular user to a particular client using IdentityServer
I am using IdentityServerV3 for authenticating users for few clients. I am having problems configuring IdentityServer in such a way that a specific user must be able to login to a specific `client.
Let's take the below scenario :
I have 2 clients …

Venkata Dorisala
- 4,783
- 7
- 49
- 90
3
votes
1 answer
C#: modifying Owin response stream causes AccessViolationException
I'm attempting to use some custom Owin middleware to modify (in this case, completely replace) the response stream in specific circumstances.
Anytime I make a call that does trigger my middleware to replace the response, everything works properly.…

fdmillion
- 4,823
- 7
- 45
- 82
3
votes
1 answer
Branching ASP.NET Core Pipeline Authentication
My application is currently using Basic authentication but I want to transition to OAuth, so there will be a short period where both types of authentication need to be used. Is there some way to branch my ASP.NET Core pipeline like so:
public void…

Muhammad Rehan Saeed
- 35,627
- 39
- 202
- 311
3
votes
0 answers
Microsoft Owin Response Body Encoding
In my OwinMiddleware I just write out to the body:
await context.Response.Body.WriteStringAsync("Hey There");
The raw response I get in Fiddler is:
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Server: Microsoft-HTTPAPI/2.0
Date: Fri, 13 May 2016…

Callum Linington
- 14,213
- 12
- 75
- 154
3
votes
1 answer
Web Api 2 get controller and action name in OWIN middleware?
How can I retrieve the api controller name and api action name inside a piece of custom OWIN middleware? I can do it inside of a message handler like so:
var config = request.GetConfiguration();
var routeData =…

BBauer42
- 3,549
- 10
- 44
- 81
3
votes
2 answers
AngularJS, .NET Web API, and back-end authorization when returning views in a SPA
So I want to write a SPA using AngularJS and .NET Web API. I want Angular to handle most of the routing. But how do I prevent unauthorized users (regardless of authentication) from getting certain views? I want to do this on the back-end, without…

Alexander Li
- 33
- 5
2
votes
1 answer
Authentication.Challenge not working with ApiController
With ApiController, Authentication.Challenge not prompting Microsoft login for SSO. it executes SignIn action method, with out any errors. If I change from ApiController to Controller then it's prompting. does any one know how to prompt for…

nara
- 21
- 3
2
votes
1 answer
OWIN middleware notifications not being called from MSAL for Azure B2C directory
Currently I'm having a hard time trying to figure this out...
I have an Azure B2C Angular SPA app that uses MSAL in the front-end. In the back-end it's ASP.NET MVC with full .NET Framework.
I had an application working beautifully with ADAL in the…

Leniel Maccaferri
- 100,159
- 46
- 371
- 480
2
votes
0 answers
How can I configure multiple JWT bearer token authorization with .net-standard
I have a Web API application built for the .net standard 2.0 framework (not .net core) that configures oAuth2 security for a single issuer. I need to add support for an additional issuer so that the API can handle both JWT token formats and…

Paul Keegstra
- 21
- 2
2
votes
1 answer
OWIN shows yellow screen of death
We have an old web form project and we want to add OWIN to it.
A Startup class is added to the project. We have both assebmly attribute and config owin:appStartup app key in place.
We have referenced Microsoft.Owin.Host.SystemWeb version 4.0.0.0 in…

Beatles1692
- 5,214
- 34
- 65
2
votes
0 answers
OWIN Middleware not able to set http status code
I am running WebAPI with just one Middleware and not able to set response HTTP status code.
I am using OnSendingHeaders() and able to add headers and set response body, but status code is not getting set and response always has it set as 200 OK.
I…

Kapil
- 21
- 3
2
votes
0 answers
Jwt type won't load alongside integrated twilio
I have integrated twilio and it has updated packages of jwt and now i am
getting error for this UseJwtBearerAuthentication() method. How
can i resolved this error as i cannot downgrade my packages since it has a
dependency for twilio?
private…

Jayant Belekar
- 243
- 1
- 3
- 9
2
votes
1 answer
Authorize ASP.net mvc actions methods using bearer token
I have an asp.net web api as authorization server where it generate bearer token with user claims when passing ussr/pass to its endpoint. Now i need to authenticate my asp.net mvc first by getting a token and then authorize my mvc action methods…

Reza Shirazi
- 359
- 5
- 17
2
votes
0 answers
How to get OAuth2 OpenId token from Identity Server 4 for client that uses OWIN
I am using IdentityServer4 to get my OpenId tokens for my web app.
But my web app uses Owin for security. I cannot find any example samples of where this is done.
So this code works;
In my client;
using Microsoft.Owin.Security.Cookies;
using…

arame3333
- 9,887
- 26
- 122
- 205