Owin-based Web server Katana release version 3

Source: Internet
Author: User
Tags oauth openid hosting support microsoft

The era was different when ASP was first released in 2002. At that time, the Internet was still in its infancy, with about 569 million users, each with an average of 46 minutes of Internet access per day and about 3 million sites. Just 10 years later, the same measurements revealed that there were about 2.27 billion internet users, each with an average of 4 hours of Internet access per day, and about 555 million sites. Along with the development of network application, ASP. NET also comes with new technologies, such as ASP. WEB MVC and ASP. The next direction for Web application development is to enter cloud computing, and Katana Engineering provides the basic modules for ASP, making network applications more flexible, lighter, more portable, and better-in other words, katana engineering can optimize your ASP.

The Katana project can actually be traced to an open source project called Open Web Inter-face for. NET (OWIN) outside of Microsoft. OWIN is a specification that defines the interaction between Web servers and application components (see owin.org). Because the purpose of this specification is to develop a broad, dynamic, Microsoft. NET Framework-based WEB server and application component ecosystem, it can reduce the interaction between servers and applications to a small subset of types and individual function signatures. This function signature is called an application delegate (that is, Appfunc):

using Appfunc = func<idictionary<stringobject;, task>;

Each component in an OWIN-based application provides an application delegate to the server. These components are then linked into a pipeline, and the OWIN-based server pushes the request to the pipeline. In order to use resources more efficiently, all components in the pipeline should be asynchronous, which is reflected in the application delegate that returns the Task object. With Release 3, Kanata has now fully supported the newly added asynchronous programming model in. NET 4.5. Although ASP has started supporting the asynchronous programming model 10 years ago, the IAsyncResult model introduced in. NET 2.0 is cumbersome to use, and most developers don't even know it exists. node. JS is in the swoop, calling itself the advanced asynchronous Web development platform, while Microsoft wants to recapture the title by Async/await model introduced in. NET 4.5.

All States, including application state, request state, and server state, are saved in the idictionary<string, object> object specified on the application delegate. This data structure is called an environment dictionary, which is passed from one component to another as the request passes through the pipeline. Although Ningho/value data can be inserted into an environment dictionary, the OWIN specification defines keys for some HTTP core elements.

Required Environment Dictionary key for HTTP requests

Key Name Value Description
"Owin. Requestbody " A stream with the request body (if any). If there is no request body, stream.null can be used as a placeholder.
"Owin. Requestheaders " Idictionary<string of the request header, string[]>
"Owin. Requestmethod " A string that contains the requested HTTP request method (for example, GET and POST).
"Owin. Requestpath " A string that contains the request path. This path must be the relative path to the "root" of the application delegate.
"Owin. Requestpathbase " A string that contains the request path portion corresponding to the "root" of the application delegate.
"Owin. Requestprotocol " A string that contains the protocol name and version (for example, http/1.0 or http/1.1).
"Owin. Requestquerystring " A string that contains the query string component of the HTTP request URI without a leading "?" (e.g. Foo=bar&baz=quux). The value can be an empty string.
"Owin. Requestscheme " A string that contains the URI scheme for the request (for example, HTTP or HTTPS).

Defines a set of basic Environment dictionary key/value pairs that enable many different frameworks and component authors to interoperate in a single OWIN pipeline without enforcing protocols to a particular. NET object model, such as HttpContextBase or ASP. The Httprequestmessage/httpresponsemessage protocol in the EB API.

The two elements of the application delegate and the Environment Dictionary form the OWIN specification. The Katana project is a collection of OWIN-based components and frameworks that Microsoft has created and launched.

In terms of new features, the new version focuses on "Enterprise-class authentication capabilities and claims-based identity (claims-based identity)." Vittorio Bertocci, who participated in the Katana 3 project, specifically mentioned the following three protocols:

    • Ws-federation
    • OpenId Connect (available via form submission Id_token and Id_token+code mode)
    • OAuth2 Ticket token authentication that can be used in the Web API

Vittorio also wrote:

This release also addresses issues caused by changes in Twitter and Google APIs. If you use Google Certification in your app and plan to upgrade to Katana version 3, make sure you've read this post!

Katana can be obtained as a nuget package. According to the Katana website description, depending on the different features you need, a total of more than 20 packages can be downloaded: (This is a stark contrast to the traditional ASP, which is the way to accumulate almost all of the features in a large assembly.) )

  • microsoft.owin– provides a set of auxiliary types, as well as various abstract types that are built to simplify the creation of Owin components.
  • Microsoft.owin.diagnostics– provides a variety of middleware components to assist in the development of Owin-based applications.
  • microsoft.owin.filesystems– This package provides a file system-related abstraction and implementation.
  • microsoft.owin.testing– provides some helper classes for unit testing of Owin components.
  • microsoft.owin.selfhost– contains some of the components necessary to host Owin-based applications in a self-specified process.
  • microsoft.owin.hosting– provides the default underlying framework types that are required to host and run Owin-based applications.
  • owinhost– provides a single executable program (OwinHost.exe) that allows you to host a Owin-based application run.
  • microsoft.owin.cors– This package contains components that enable cross-domain resource sharing (Cors) in the Owin middleware.
  • microsoft.owin.staticfiles– This package contains some Owin middleware that can handle requests from file system resources, including files and directories.
  • microsoft.owin.security– contains a number of common types that are shared by a variety of different authentication middleware components.
  • microsoft.owin.security.activedirectory– a set of middleware that allows applications to authenticate using Microsoft technology.
  • microsoft.owin.security.cookies– allows applications to use cookie-based authentication middleware, similar to the way forms are authenticated in ASP.
  • microsoft.owin.security.facebook– allows applications to support some of the middleware of the OAuth 2.0 certification workflow that Facebook uses.
  • The microsoft.owin.security.google– includes a set of middleware that supports Google's OpenID and OAuth 2.0 certified workflows.
  • microsoft.owin.security.jwt– a set of middleware that allows applications to protect and validate JSON web tokens.
  • microsoft.owin.security.microsoftaccount– a set of middleware that allows applications to support Microsoft account certification workflows.
  • microsoft.owin.security.oauth– allows applications to support middleware for any standard OAuth 2.0 certified workflow.
  • microsoft.owin.security.openidconnect– middleware that allows applications to authenticate using the Openidconnect method.
  • microsoft.owin.security.twitter– allows applications to support the middleware of Twitter's OAuth 2.0 authentication workflow.
  • microsoft.owin.security.wsfederation– allows applications to use Wsfederation for authentication middleware.
  • microsoft.owin.host.httplistener– is a Owin server that is created based on the HttpListener class in the. Net framework and is the default server currently being used for self-hosting.
  • Microsoft.owin.host.systemweb– is also a Owin server implementation, but it allows Owin-based applications to run in IIS and to use the request pipeline for ASP.

Owin-based Web server Katana release version 3

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.