如果我在Visual Studio 2013中有一个现有的项目,我该如何更改身份验证方式? 在新建项目设置期间,有一个"更改身份验证"按钮,但我找不到现有项目的等价物。
如果我在Visual Studio 2013中有一个现有的项目,我该如何更改身份验证方式? 在新建项目设置期间,有一个"更改身份验证"按钮,但我找不到现有项目的等价物。
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();
}
}
这是您的身份验证配置
在有更好的答案出现之前:
手动编辑您的web.config和FederationMetadata.xml文件。