简体   繁体   English

授权码授予授权协议中的OAuth-2.0瓶颈

[英]OAuth-2.0 bottleneck in Authorization Code Grant authorization protocol

Consider OAuth-2.0 Authorization Code Grant protocol. 考虑OAuth-2.0授权代码授予协议。

As described in standard draft http://tools.ietf.org/html/ietf-oauth-v2-26 on Figure 3 : Authorization Code Flow a Client is getting token on behalf of Authorization Code received from User-Agent . 如标准草案http://tools.ietf.org/html/ietf-oauth-v2-26中所述Figure 3 : Authorization Code FlowClient代表从User-Agent收到的Authorization Code获取令牌。 Suppose that User-Agent is intentionally sending wrong codes to the Client . 假设User-Agent故意将错误代码发送给Client If Authorization Server makes some protection against brute force way of obtaining Access Token by banning Client for some reasonable amount of time (by IP or by Redirection URI host name). 如果Authorization Server通过在合理的时间内(通过IP或通过Redirection URI主机名)禁止Client采取某种保护措施来防止brute force获取Access Token的方式。 If in our case the Client is supposed to process horde of requests from multiple different User-Agent's the Client will stop to serve all its users altogether if there's only one malicious one exists. 如果在我们的情况下, Client应该处理来自多个不同User-Agent's大量请求,则如果只存在一个恶意Client则该Client将停止为所有用户提供服务。

So the Client becomes a bottleneck in a situation described above. 因此,在上述情况下, Client将成为瓶颈。

==== EDITED ==== Any ideas how to evade the bottleneck problem? ====编辑====任何想法如何规避瓶颈问题?

I believe you're asking: "how to evade this problem and NOT to expose Authorization Code to User-Agent?" 我相信您在问:“如何规避此问题,而不是将授权代码暴露给User-Agent?”

This is not possible. 这是不可能的。 The OAuth request flows through the user's browser so you can't prevent exposing the authorization code to the user. OAuth请求流经用户的浏览器,因此您不能阻止向用户公开授权代码。

If you're a victim to an attack like this, I'd suggest putting the same protection into your Client that the OAuth provider is putting into their Authorization Server. 如果您是此类攻击的受害者,建议您将与OAuth提供程序要放入其授权服务器中的客户端相同的保护放到您的客户端中。 Namely, stop allowing new authorization codes to be sent from a User-Agent that's abusing your service. 即,停止允许从滥用您的服务的User-Agent发送新的授权码。 If they send more than, say, 3 invalid tokens per hour, ban them for an hour or two (by IP address). 如果它们每小时发送超过3个无效令牌,请禁止它们使用一两个小时(按IP地址)。 Of course, this could lead to you denying access to your site from proxy servers because of one bad user on the proxy, but that's life. 当然,这可能会导致您由于代理上的一个错误用户而拒绝从代理服务器访问站点,但这就是生命。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM