无法'UseOAuthBearerTokens'与Owin和Identity RTM合作



我使用

 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/返回错误:

找不到资源。

    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。

相关内容

  • 没有找到相关文章

最新更新