owin middleware in vnext

26
Custom Middleware with OWIN & Katana (in ASP.NET vNext) ONDREJ BALAS @ONDREJBALAS WWW.ONDREJBALAS.COM [email protected]

Upload: ondrejbalas

Post on 06-Aug-2015

99 views

Category:

Software


4 download

TRANSCRIPT

Custom Middlewarewith

OWIN & Katana (in ASP.NET vNext)

ONDREJ BALAS

@ONDREJBALAS WWW.ONDREJBALAS.COM

[email protected]

Titanium Sponsors

Platinum Sponsors

Gold Sponsors

ONDREJ BALAS Microsoft MVP in C#

Writer for Visual Studio Magazine

Owner of UseTech Design

Building software that drives business

Serial Entrepreneur

WWW.ONDREJBALAS.COM

[email protected] @ONDREJBALAS

Web Server & Host

Web Server & Host (IIS)TCP

HTTP

Web Server & Host (IIS)

System.Web

Web Server & Host (IIS)

System.Web

Web Server & Host (IIS)

Katana

Katana

vNext

vNext

Middleware

<configuration> <system.web> <httpModules> <add name="HelloWorldModule" type="HelloWorldModule"/> </httpModules> </system.web> </configuration>

Implementing IHttpModule

Middleware is for cross-cutting concerns

Logging

Access Control (Authentication & Authorization)

Routing

Serving Special Content

Any other time you want to do some THING between receiving a request and returning a response, even if that THING is preventing something else from happening.

Middleware CodeVISUAL STUDIO 2015 RC

PROJECT TYPE: ASP.NET WEB APPLICATION

TEMPLATE: WEB SITE (ASP.NET 5 PREVIEW TEMPLATE)

AUTHENTICATION: NO AUTHENTICATION

// Do something before

await _next(context);

// Do something after

Middleware

// Do something before

await _next(context);

// Do something after

Middleware

// Do something before

await _next(context);

// Do something after

// Do something before

await _next(context);

// Do something after

Middleware

// Do something before

await _next(context);

// Do something after

// Do something before

await _next(context);

// Do something after

// Do something before

await _next(context);

// Do something after

Middleware

// Do something before

await _next(context);

// Do something after

// Do something before

await _next(context);

// Do something after

String Appender Static File MVC

// Do something before

await _next(context);

// Do something after

Middleware

// Do something before

await _next(context);

// Do something after

// Do something before

await _next(context);

// Do something after

String Appender Static File MVC

Middleware CodeVISUAL STUDIO 2015 RC

PROJECT TYPE: ASP.NET WEB APPLICATION

TEMPLATE: WEB SITE (ASP.NET 5 PREVIEW TEMPLATE)

AUTHENTICATION: NO AUTHENTICATION

Thanks!

ONDREJ BALAS

WWW.ONDREJBALAS.COM [email protected]

@ONDREJBALAS

GITHUB.COM/ONDREJBALAS