Visual Studio 2013更改现有项目的身份验证
如果我在Visual Studio 2013中有现有项目,如何更改身份验证?在新的项目设置过程中,有一个“更改认证”按钮,但我无法找到现有项目的等效项目。Visual Studio 2013更改现有项目的身份验证
直到有人想出了一个更好的答案:
编辑你的web.config和FederationMetadata.xml手动。
如果你的项目是ASP.NET MVC,并且在2013年使用新模板,它应该在OWIN上运行,这样就有一个部分类的启动看看里面,如果你有它,有一个文件 Startup.Auth的.cs是部分启动的还有我这个
public partial class Startup
{
// For more information on configuring authentication, please visit http://go.microsoft.com/fwlink/?LinkId=301864
public void ConfigureAuth(IAppBuilder app)
{
// Enable the application to use a cookie to store information for the signed in user
app.UseCookieAuthentication(new CookieAuthenticationOptions()
{
AuthenticationType = DefaultAuthenticationTypes.ApplicationCookie,
LoginPath = new PathString("/Authentication/Login")
});
// Use a cookie to temporarily store information about a user logging in with a third party login provider
app.UseExternalSignInCookie(DefaultAuthenticationTypes.ExternalCookie);
// Uncomment the following lines to enable logging in with third party login providers
//app.UseMicrosoftAccountAuthentication(
// clientId: "",
// clientSecret: "");
//app.UseTwitterAuthentication(
// consumerKey: "",
// consumerSecret: "");
//app.UseFacebookAuthentication(
// appId: "",
// appSecret: "");
//app.UseGoogleAuthentication();
}
}
在那里,是你的验证配置
这假定已经通过软件包管理器控制台安装了“开放的.NET接口”(Owin): 安装包Owin –
这可以从项目属性来完成。我张贴的链接article which explains how to do this.
查看属性窗口中的section header,它是* Development Server *。问题是关于项目的认证,而不是服务器的。 – Travis
在Visual Studio 2013,我会重新运行身份和访问工具,可从该项目上右击。 – Travis
你的意思是VS 2012?在VS 2013中右键点击什么都没有显示! – nzpcmad
@nzpcmad,是的,啊! VS2012有IATool。 VS2013什么也没有。 :-( – Travis