[[Open棟梁Project>http://opentouryo.osscons.jp/]] - [[マイクロソフト系技術情報 Wiki>http://techinfoofmicrosofttech.osscons.jp/]]

-[[戻る>OWIN]]

* 目次 [#p11234e4]
#contents

*概要 [#s2cb1789]
-[[ホスティング ランタイム>#le7af00c]]をインストールする。
-利用したい、OWINミドルウェアをインストールする。
-[[Startupクラス>#n017a299]]を追加して、OWIN関連の設定を行う。

*ホスティング ランタイム [#le7af00c]
**IIS [#s102fafa]
-IIS でホストするには、Microsoft.Owin.Host.SystemWebを使用する。

-NuGet で「Microsoft.Owin.Host.SystemWeb」をインストール。
 install-package Microsoft.Owin.Host.SystemWeb

-System.WebのパイプラインをOWINのパイプラインに流すことができる。
-これにより、OWINのミドルウェアをASP.NET Web Formsや、MVC 5でも使用できる。

**OwinHost.exe [#ibe04f08]
-Katana の OwinHost.exe でホストするには、OwinHostを使用する。

-NuGet で「OwinHost」をインストール。
 install-package OwinHost

*OWINミドルウェア [#c666e4bd]
**OWINミドルウェアのインストール [#k436c439]
***[[ASP.NET Identity]] [#x8cab528]
***[[ASP.NET SignalR]] [#x8cab528]
***[[ASP.NET Web API]] [#n73a0003]

**OWINのパイプラインとミドルウェア作成 [#o8b46ad1]
この「ミドルウェア」を自作すればパイプライン処理の挙動をカスタマイズできる。

-neue cc - OWINのパイプラインとMiddleware作成ガイド~
http://neue.cc/2014/01/06_442.html

-neue cc - OWINの仕組みとOWIN上のフレームワーク(ミドルウェア)の作り方~
http://neue.cc/2014/05/13_473.html

*Startupクラスの追加・登録 [#n017a299]
OWINパイプラインでミドルウェアをつなげ全体を処理する。

Startupクラスは、
-ホスティング ランタイムと
-ミドルウェア

を指定して使用できるようにする。

**共通 [#ye660630]

**個別 [#ycfa2720]
***[[ASP.NET Identity]] [#p8d75cdd]
***[[ASP.NET SignalR]] [#d0df6846]
***[[ASP.NET Web API]] [#n4d2e2af]

*既定のプロジェクト・テンプレートの調査 [#e4fddd28]

**VS2010 [#ne9d5379]

***WebForms [#x12a00b7]
非OWIN

***MVC [#ob6f19b8]
非OWIN

**VS2012 [#jcd3c4f6]

***WebForms [#n6268fca]
-非OWIN

-以下がサポートされた
--BundleConfig
--AuthConfig
--RouteConfig

-モジュール
--Bundleには以下のモジュールが使用されている。
---System.Web.Optimization

--Authenticationには以下のモジュールが使用されている。
---DotNetOpenAuth
---Microsoft.AspNet.Membership
---System.Web.Security.Membership

--Routingには以下のモジュールが使用されている。
---Microsoft.AspNet.FriendlyUrls

***MVC [#f8de12b5]
-MVC3
--非OWIN
--OAuthは未サポート

-MVC4
--非OWIN
--OAuth
---DotNetOpenAuth
---Microsoft.Web.WebPages.OAuth
---Webmatrix.Webdata.Websecurity
---System.Web.Security.Membership

**VS2013 [#rea2d27d]

***WebForms [#n6268fca]
-認証対応テンプレート

--組織アカウント~
恐らくWIFを使用してWS-Federationの認証連携を行う。

--個人アカウント
OWINミドルウェアである~
[[ASP.NET Identity]]を使用するためにOWIN化対応がなされている。

-[[上記>#n6268fca]]から以下の変更が加えられた。

--Authenticationは以下のモジュールに変更された。
---Microsoft.AspNet.Identity.Core
---Microsoft.AspNet.Identity.Owin
---Microsoft.Owin.Security

***MVC [#f8de12b5]
-変更内容は[[WebForms>#n6268fca]]と同様。

**VS2015 [#h8e67ca1]
大枠、[[2013>#rea2d27d]]と同じ。

*参考 [#m5f3b2af]
-Katana で Hello, world - miso_soup3 Blog~
http://miso-soup3.hateblo.jp/entry/2013/11/11/014258

-asp.net mvc - What is the new Startup.cs file for in Visual Studio 2013 projects? - Stack Overflow~
http://stackoverflow.com/questions/20034105/what-is-the-new-startup-cs-file-for-in-visual-studio-2013-projects

-c# - Do I need a Global.asax.cs file at all if I'm using an OWIN Startup.cs class and move all configuration there? - Stack Overflow~
http://stackoverflow.com/questions/20168978/do-i-need-a-global-asax-cs-file-at-all-if-im-using-an-owin-startup-cs-class-and

-OWIN Startup Class Detection | The ASP.NET Site~
https://www.asp.net/aspnet/overview/owin-and-katana/owin-startup-class-detection
>Every OWIN Application has a startup class where you specify components for the application pipeline.~
There are different ways you can connect your startup class with the runtime,~
depending on the hosting model you choose (OwinHost, IIS, and IIS-Express).

トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS