无法获得“UseOAuthBearerTokens”与Owin和Identity RTM一起使用

本文关键字:Identity RTM 一起 Owin UseOAuthBearerTokens | 更新日期: 2023-09-27 18:34:01

我使用

 app.UseOAuthBearerTokens(OAuthOptions);

var options = new OAuthAuthorizationServerOptions
{
    TokenEndpointPath = new Microsoft.Owin.PathString("/Token"),
    AuthorizeEndpointPath = new Microsoft.Owin.PathString("/api/Account/ExternalLogin"),
    Provider = new ApplicationOAuthProvider<CampusDaysUser>(PublicClientId, IdentityManagerFactory, CookieOptions)
};

但是网址 http://example.com/Token/返回错误:

找不到资源。

无法获得“UseOAuthBearerTokens”与Owin和Identity RTM一起使用

    OAuthOptions = new OAuthAuthorizationServerOptions
    {
        TokenEndpointPath = new Microsoft.Owin.PathString("/Token"),
        AllowInsecureHttp = true,
        AuthorizeEndpointPath = new Microsoft.Owin.PathString("/api/Account/ExternalLogin"),
        Provider = new ApplicationOAuthProvider<CampusDaysUser>(PublicClientId, IdentityManagerFactory, CookieOptions)
    };

需要设置允许 http 现在让它工作。阅读评论,这应该只在开发中完成。生产 您应该获得证书并使用SSL。