Visual Studio 2013 更改现有项目的身份验证方式

23

如果我在Visual Studio 2013中有一个现有的项目,我该如何更改身份验证方式? 在新建项目设置期间,有一个"更改身份验证"按钮,但我找不到现有项目的等价物。


在Visual Studio 2013中,我会重新运行身份验证和访问工具,该工具可从右键单击项目中获得。 - Travis Watson
你是不是想说的是VS 2012?在VS 2013中右键单击没有任何显示! - rbrayb
@nzpcmad,是的,啊!VS2012有IATool。而VS2013却什么都没有。 :-( - Travis Watson
7
在此投票支持功能:http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/4855136-in-vs-2013-allow-ability-to-run-the-change-authentication的运行权限 - rbrayb
大家好,我在这个链接中找不到视图?有人能找到吗?http://www.asp.net/visual-studio/overview/2013/creating-web-projects-in-visual-studio#orgauthonprem - albatross
3个回答

9

2
看一下属性窗口中的部分标题,它是“开发服务器”。问题是关于项目的身份验证,而不是服务器的。 - Travis Watson

0
如果您的项目是ASP.NET MVC,并使用2013年的新模板,则应在OWIN上运行。因此,有一个部分类Startup,请查看并确保您有一个名为Startup.Auth.cs的文件,它是Startup的部分。我在那里放置了以下内容:
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();

    }
} 

这是您的身份验证配置


假设已经通过包管理器控制台安装了“Open Web Interface for .NET”(Owin):Install-Package Owin - Carl Prothman

0

在有更好的答案出现之前:

手动编辑您的web.config和FederationMetadata.xml文件。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接