为什么redirect URL必须完全匹配?在域级别进行匹配是否不足以提供适当的安全性?
如果我有数百条路径怎么办?
示例网址:
...
我将不得不在我的B2C应用配置中输入上述4个重定向网址。
最佳答案
实际上,这是在RFC 6819“OAuth 2.0威胁模型和安全注意事项”部分4.1.5,4.2.4和5.2.3.5中讨论的。
4.1.5. Threat: Open Redirectors on Client
An open redirector is an endpoint using a parameter to automatically redirect a user agent to the location specified by the parameter value without any validation. If the authorization server allows the client to register only part of the redirect URI, an attacker can use an open redirector operated by the client to construct a redirect URI that will pass the authorization server validation but will send the authorization "code" or access token to an endpoint under the control of the attacker.
Impact: An attacker could gain access to authorization "codes" or access tokens.
Countermeasures:
o Require clients to register full redirect URI (Section 5.2.3.5)."
Section 5.2.3.5讨论了这种限制过于严格的情况,目的是提供替代解决方案。
通常,如Chris建议的那样,
state
参数还可用于确定性重定向。但是,您必须确保这样的解决方案也不会最终成为开放的重定向器,因此state
参数将需要受到保护(例如,加密/签名),或者与Cookie结合使用。
关于azure-ad-b2c - 为什么重定向URL在Azure AD B2C中完全合格?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47520604/