kez kez - 7 months ago 64
C# Question

The name 'ConfigureAuth' does not exist in the current contex

I'm getting an Error when I'm attempting to run my page says that,

The name 'ConfigureAuth' does not exist in the current context

in My Stratup Class . I'm sure all
AspNet Identity
libraries are installed. What do I need to do next to try to fix this?

using Microsoft.Owin;
using Owin;
[assembly: OwinStartupAttribute(typeof(project_name.Startup))]
namespace project_name
public partial class Startup
public void Configuration(IAppBuilder app)


If you are using default Visual Studio project template, the ConfigureAuth method could be found in partial class Startup.Auth.cs. So make sure you didn't break anything when modifying project structure.

This is an example of ConfigureAuth method:

// For more information on configuring authentication, please visit
public void ConfigureAuth(IAppBuilder app)
    // Configure the db context and user manager to use a single instance per request

    // Enable the application to use a cookie to store information for the signed in user
    // and to use a cookie to temporarily store information about a user logging in with a third party login provider
    app.UseCookieAuthentication(new CookieAuthenticationOptions());

    // Configure the application for OAuth based flow
    PublicClientId = "self";
    OAuthOptions = new OAuthAuthorizationServerOptions
        TokenEndpointPath = new PathString("/api/Token"),
        Provider = new ApplicationOAuthProvider(PublicClientId),
        AuthorizeEndpointPath = new PathString("/api/Account/ExternalLogin"),
        AccessTokenExpireTimeSpan = TimeSpan.FromDays(14),
        AllowInsecureHttp = true

    // Enable the application to use bearer tokens to authenticate users