0

When working with the new Web API 2 oauth. It works fine locally, but when published on a server it does not work. I am assuming that ASP has some sort of local DB that they store all of the accounts on and my server does not have access to this (maybe I am wrong). Has anyone ran into this issue or sure how to get this working on a server? Thanks for any help.

http://www.asp.net/vnext/overview/authentication/individual-accounts-in-aspnet-web-api#register

4

1 に答える 1

1

サーバーに SQL Server がインストールされていますか? そうでない場合、それが問題になるはずです。バックグラウンドで認証を行うASP.NET Identityは通常、SQL Server に対して機能し、変更を行っていない場合は独自のデータベースを作成します ( IdentityDbContextから継承する独自のコンテキストを作成する場合は、Entity Framework コンテキストを変更できます)。 )。

web.config ファイルを見てください。DefaultConnectionという名前の接続文字列が必要です。これは、ASP.NET Identity が接続するデータベースです。ローカルデータベースに対して機能すると思います。

サーバーに SQL Server をインストールして、ローカル PC と同じように動作するか、接続文字列を別のデータベースに変更することができます。

于 2014-01-25T13:30:22.340 に答える