Java SpringSecurity5中默认重定向URL的工作原理

Java SpringSecurity5中默认重定向URL的工作原理,java,spring-boot,spring-security,oauth-2.0,spring-security-oauth2,Java,Spring Boot,Spring Security,Oauth 2.0,Spring Security Oauth2,我已经浏览了下面的帖子。我仍然无法理解重定向uri的概念 在identity server中,我们注册了客户机应用程序,对于代码授予类型,我们告知这将是我们的重定向url,即。https://someserver:port/ 然而,spring和其他帖子建议将重定向uri设置为{baseUrl}/login/oauth2/code/{registrationId} 如果将重定向uri设置为https://someserver:port/ 在identity server中,如何{baseU

我已经浏览了下面的帖子。我仍然无法理解重定向uri的概念

在identity server中,我们注册了客户机应用程序,对于代码授予类型,我们告知这将是我们的重定向url,即。https://someserver:port/

然而,spring和其他帖子建议将重定向uri设置为{baseUrl}/login/oauth2/code/{registrationId}

如果将重定向uri设置为https://someserver:port/ 在identity server中,如何{baseUrl}/login/oauth2/code/{registrationId}即。https://someserver:port/login/oauth2/code/{registrationId}将起作用。它不应该给出无效的重定向uri吗

请更正我的理解。

参数“redirectUrl”用于保护授权码与访问令牌的交换,以便由一个可用于重定向的URL之一的服务执行

如果您使用
https://someserver:port/*
,则它将匹配该服务器上的所有端点。当依赖默认的Spring安全端点
{baseUrl}/login/oauth2/code/{registrationId}
时,最好在重定向URL配置中指定并使用
https://someserver:port/login/oauth2/code/{registrationId}
作为值。这两个选项都能正常工作,但后者更安全