OWIN Middleware in the IIS integrated pipeline
Questions tagged [owin-middleware]
266 questions
8
votes
1 answer
Why does the order of auth middleware declaration matter in Owin Startup class?
I read some examples(1,2,3,4) about setting up authentication in the owin pipeline when using web api and the examples declare the
authentication middleware as the first middleware in the Configuration method but doesn't tell why it needs to be…

Marcus Höglund
- 16,172
- 11
- 47
- 69
8
votes
1 answer
Get the Route Template from IOwinContext
I am looking to get the route template from a request. I am using OwinMiddleware and am overriding the Invoke method accepting the IOwinContext.
public override async Task Invoke(IOwinContext context)
{
...
}
Given the Request URL:…

scottmgerstl
- 765
- 8
- 18
7
votes
1 answer
Prevent Google Chrome from sending Sec-Fetch headers
I would like to cache static content (index.html) in my web API 2 (net. framework 4.6.2 app)
I wrote OWIN middleware that adds a cache-control header to the response, allowing for subsequent requests to be retrieved from the browser cache.
The OWIN…

AllmanTool
- 1,384
- 1
- 16
- 26
7
votes
1 answer
Scope in Middleware and Blazor Component
I'm working on a server-side Blazor application and ran into some problems regarding a scoped service.
For simplicity's sake I have re-created my issue using the default Blazor template (the one with the counter).
I have a service "CounterService",…

MBirk
- 71
- 4
7
votes
1 answer
Bad Request (400) when using Web API Token Authentication from Angular JS
I want to establish Web API Token Authentication with Angular JS as client. I am very new to this concept of Token Authentication inside Web API.
I do not want to use ASP.NET Identity default tables to add or authenticate user. I have my own…

simple user
- 349
- 3
- 22
- 44
7
votes
2 answers
How do I pass custom claims via ASP.NET Identity's FacebookAuthenticationProvider?
Starting with Visual Studio's "Web API" project template, I am attempting to add custom claims to the token created by the /Api/Account/ExternalLogin endpoint. I add these via the FacebookAuthenticationProvider.OnAuthenticated callback, but they do…

Jeremy Caney
- 7,102
- 69
- 48
- 77
6
votes
1 answer
OWIN Startup with Serilog in ASP.NET 4.6
I'm trying to integrate serilog for global handling of exceptions, however when I try to add ILoggerFactory as new parameter to Configuration() the app doesn't load because it can't recognize the OWIN Startup.cs anymore. Can anyone tell if I'm…

xird
- 775
- 1
- 8
- 16
6
votes
3 answers
ASP.NET with OpenIdAuthentication: redirect to url if not authorized
I am attempting to write an ASP.NET application that uses a hybrid authentication scheme.
A user can either have his username and password hash stored in the UserStore, or he can authenticate via Azure Active Directory.
I have created the login form…

Andrew Shepherd
- 44,254
- 30
- 139
- 205
6
votes
1 answer
Area based authentication using OWIN
I am developing an MVC5 web application. This application has 2 areas, 'SU' and ''App'. Each area should be authenticated independently. Each area also have their own login pages.
I am using OWIN for authenticating users.
Now the issue is, I am…

Basavaraj Metri
- 836
- 1
- 14
- 27
6
votes
0 answers
How do I Sign In using OWIN with SAML ticket returned from ADFS using ASP.NET MVC?
I have a website that has it's own login screen, where the user types in their username and password. Upon hitting the login button, the user should be authenticated through ADFS, and I should get a SAML token back. This works. At this point though,…

Chris
- 363
- 1
- 4
- 16
6
votes
2 answers
Owin only serve files in certain folder
So I am playing around with Owin and Katana and I want to serve static files in my public folder.
I have a Content folder with stylesheets and a scripts folder.
My Startup:
public void Configuration(IAppBuilder app)
{
#if DEBUG
…

user1613512
- 3,590
- 8
- 28
- 32
6
votes
3 answers
How to use OWIN middleware to rewrite versioned url for request to static file?
e.g. I have a file located on the server at /Content/static/home.html. I want to be able to make a request to /Content/v/1.0.0.0/static/home.html (for versioning), and have it rewrite the url so it accesses the file at the correct url, using OWIN…

Ben Wilde
- 5,552
- 2
- 39
- 36
5
votes
1 answer
.NET Framework equivalent of IApplicationBuilder.UseForwardedHeaders()
I'm working with a ASP.NET WebForms application running on .NET Framework 4.7.2 which is sitting behind an Azure Application Gateway. The gateway performs SSL hand-off so is adding a X-Forwarded-Proto="https" header.
I also have a .NET Core API in…

awj
- 7,482
- 10
- 66
- 120
5
votes
1 answer
Automatic code( authorization code ) redemption using latest version of Katana DLLs in openId authorization code flow
From the recent release and conversation below, it says that now Katana(4.1.0) supports code-flow with automatic code redemption(that meaning we do not have call tokenendpoint explicitly to redeem the code for idtoken, accesstoken…

nari447
- 834
- 2
- 11
- 25
5
votes
2 answers
Sharing single WebApp and API deployment with multiple B2C Tenants
Current scenario:
Web App and Web API are authenticated using AAD B2C and working fine. Each customer has a unique tenant. OpenIdConnectAuthenticationOptions (web app) and OAuthBearerAuthenticationOptions (api) are set at the application Startup.…

Kaf
- 33,101
- 7
- 58
- 78