ASP.NET WebAPI - 处理本地登录的方法在哪里?

ASP.NET WebAPI - Where is the method which handles local login?

我正在阅读 asp.net 网络 api 中的本地登录 link。 http://www.asp.net/web-api/overview/security/individual-accounts-in-web-api 但是,当查看以下将用户的登录数据发送到服务器以对用户进行身份验证的代码时,我无法找出 asp.net web api 中处理本地登录的默认方法。 那么,它到底在哪里?

var loginData = {
grant_type: 'password',
username: self.loginEmail(),
password: self.loginPassword()
};

$.ajax({
type: 'POST',
url: '/Token',
data: loginData
}).done(function (data) {
self.user(data.userName);
// Cache the access token in session storage.
sessionStorage.setItem(tokenKey, data.access_token);
}).fail(showError);

我遇到了同样的问题。我终于意识到它调用的 url 是 /Token:

    $.ajax({
        type: 'POST',
        url: '/Token',  //!! plain as day !!!
        data: loginData
    }).done(function (data) {
        self.user(data.userName);
        // Cache the access token in session storage.
        sessionStorage.setItem(tokenKey, data.access_token);
    }).fail(showError);

这设置为与 Startup.Auth.cs

中的 ApplicationOAuthProvider 相关联
        OAuthOptions = new OAuthAuthorizationServerOptions
        {
            TokenEndpointPath = new PathString("/Token"),
            Provider = new ApplicationOAuthProvider(PublicClientId),
            AuthorizeEndpointPath = new PathString("/api/Account/ExternalLogin"),
            AccessTokenExpireTimeSpan = TimeSpan.FromDays(14),
            AllowInsecureHttp = true
        };

This article帮了大忙