asp.net-web-api - 服务器独有的 OAuthAuthorizationServerProvider/AuthenticationTokenProvider 票证?

标签 asp.net-web-api oauth oauth-2.0 asp.net-web-api2

我们有一个 .Net Web API (v2),为 SPA 提供服务,我希望使用 OAuth 2 来保护该 SPA。

在我的 OWIN Startup.Configuration() 中,我将 IAppBuilder.UseOAuthAuthorizationServer 中的 Provider 设置为 OAuthAuthorizationServerProvider 的覆盖。我已成功提供刷新 token 。

我想确保这些 token 不会被实现类似提供商的人欺骗。我所做的搜索都没有给我任何答案。

OAuthAuthorizationServerProvider 是否确保收到的刷新 token 是由其自身发出的,而不是黑客计算机上的任何类似代码?

我自己的实验似乎证实了这一点 - 我尝试在两台不同的机器上运行相同的代码,并从另一台机器上获取未过期的刷新 token (有效期为 24 小时),并得到了 401,因为我' d 希望。但以防万一我错误地说服了自己,我需要比我更了解 .Net Web API 中的 OAuth 的人的一些保证和/或建议。

谢谢

保罗

最佳答案

我确信我最终在 OAuthAuthorizationServerProvider 的文档中找到了明确的答案,但现在找不到它。

但是,Dominick Baier该领域的专家表示:

Access tokens are protected using the machine key. Protection of refresh tokens is up to you. You need to manually set the machineKey element in web.config (otherwise the key gets auto generated and might change over time).

他的评论来自对post on implementing OAuthAuthorizationServerProvider的回复.

关于asp.net-web-api - 服务器独有的 OAuthAuthorizationServerProvider/AuthenticationTokenProvider 票证?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28112507/

相关文章:

c# - 如何在 ASP.NET Web API 上对 Action Filter 进行依赖注入(inject)

asp.net - 如何知道共享主机 (GoDaddy) 是否支持 ASP.NET Web API

jquery - 带 HTTPS POST 的移动应用程序安全性

security - 保护 oauth 承载 token 免受 JavaScript 应用中的 XSS、CSRF 等攻击

java - 如何将适用于 Java 的 Google Drive Client Library 与我自己开发的 Web 应用程序 OAUTH 2 框架一起使用?

javascript - 如何在 ng-repeat 上获取两个 Controller 的结果

java - 如何防止代币替换攻击?

swift - RxSwift 更新身份验证 token

Wordpress API : Get posts from private wordpress. 网站

Spring Boot 社交登录和本地 OAuth2-Server