惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

阮一峰的网络日志
阮一峰的网络日志
J
Java Code Geeks
Martin Fowler
Martin Fowler
宝玉的分享
宝玉的分享
V
Visual Studio Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
M
MIT News - Artificial intelligence
U
Unit 42
博客园 - 三生石上(FineUI控件)
博客园 - 聂微东
The GitHub Blog
The GitHub Blog
I
InfoQ
WordPress大学
WordPress大学
H
Help Net Security
D
Docker
B
Blog
腾讯CDC
A
About on SuperTechFans
Recent Announcements
Recent Announcements
雷峰网
雷峰网
有赞技术团队
有赞技术团队
C
Check Point Blog
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC

博客园 - 烟雨客

Aspose.PDF跨平台问题解决 在aspx中写c# 在动态生成的HTML中执行JS AWS 2020 Innovate所有视频 sp_executesql 可動態傳入傳出參數 the input stream is not valid binary formate.... when call remoting 用SSISl连接PostgrsSQL Ubuntu 16.04 TLS下安装dotnet异常处理 客户端不刷新 在公网上布署Web Api的时候,不能调用,返回404 在公网(internet)上建立website时不能用http访问 ClickOnce发布后不能安装 从JPG中获取缩略图 MaraDNS与DeadWood一起配置为本地机器提供小型化DNS服务 await, anync The requested page cannot be accessed because the related configuration data for the page is invalid Socket服务端口长连接最多能支持多少? Json序列化 关于获得本机Mac Address的方法
404 Not Find When using Owin with OAuth
烟雨客 · 2015-02-02 · via 博客园 - 烟雨客

在使用Owin+OAuth时,一步一步的测试时,在用

OAuthOptions = new OAuthAuthorizationServerOptions            

{                

TokenEndpointPath = new PathString("/Token"),

 Provider = new ApplicationOAuthProvider(PublicClientId),                

AuthorizeEndpointPath = new PathString("/api/Account/ExternalLogin"),                

AccessTokenExpireTimeSpan = TimeSpan.FromDays(14)

//AllowInsecureHttp = true            

};

app.UseOAuthBearerTokens(OAuthOptions);注册中间件时,

客户端在调用

        var loginData =

  {            

    grant_type: 'password',            

    username: self.loginEmail(),            

    password: self.loginPassword()         };

        $.ajax({            

    type: 'POST',            

    url: '/Token',            

    data: loginData         }).done(

    function (data) {            

      self.user(data.userName);            

        // Cache the access token in session storage.            

      sessionStorage.setItem(tokenKey, data.access_token);        

    }).fail(showError);

出现404. Not Fount错误,这显然是/Token endpoint没有启作用。在网上找到是要把AllowInsecureHttp=true打开,应该是缺省用https协议,如果没有打开它,就没有办法调用/Token endpoint的服务