Forms authentication on Azure
どうも Membership とかの out-of-box な認証が好きになれず、今のところ必要もないので自分で forms authentication ベースで書いている。そのうち気が変わるかもしれないが。
Azure に forms authentication なアプリを deploy したら、認証が全く動作しない。すったもんだの末、以下を web.config に置いて解決。
<system.webServer>
<remove name="FormsAuthenticationModule" />
<add name="FormsAuthenticationModule" type="System.Web.Security.FormsAuthenticationModule" />
</modules>
Azure に forms authentication なアプリを deploy したら、認証が全く動作しない。すったもんだの末、以下を web.config に置いて解決。
<system.webServer>
<remove name="FormsAuthenticationModule" />
<add name="FormsAuthenticationModule" type="System.Web.Security.FormsAuthenticationModule" />
</modules>
On premises IIS や開発環境では、上の定義は無用。
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\web.config に既に定義されているから。Azure 環境ではこれが抜けている模様。
コメント
コメントを投稿