我用
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/会返回错误:
无法找到资源。
答案 0 :(得分:5)
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)
};
现在需要设置allow http才能使其正常工作。阅读评论,这应该只在开发中完成。 制作你应该获得证书并使用SSL 。