Pou*_*sen 4 c# owin asp.net-identity
我用
app.UseOAuthBearerTokens(OAuthOptions);
Run Code Online (Sandbox Code Playgroud)
和
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)
};
Run Code Online (Sandbox Code Playgroud)
但是网址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)
};
Run Code Online (Sandbox Code Playgroud)
现在需要设置允许http以使其正常工作.阅读评论,这应该只在开发中完成.生产你应该获得证书并使用SSL.