我使用
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。