title: How does default redirect URL work in Spring Security 5?
body: <p>I have gone through below posts. Still I am unable to understand redirection URI concept.</p>
  <p><a href="https://www.baeldung.com/spring-webclient-oauth2" rel="nofollow noreferrer">https://www.baeldung.com/spring-webclient-oauth2</a></p>
  <p><a href="https://docs.spring.io/spring-security/site/docs/5.0.7.RELEASE/reference/html/oauth2login-advanced.html#oauth2login-advanced-redirection-endpoint" rel="nofollow noreferrer">https://docs.spring.io/spring-security/site/docs/5.0.7.RELEASE/reference/html/oauth2login-advanced.html#oauth2login-advanced-redirection-endpoint</a></p>
  <p><a href="https://docs.spring.io/spring-security/site/docs/5.2.x/reference/html/oauth2.html#oauth2login-sample-redirect-uri" rel="nofollow noreferrer">https://docs.spring.io/spring-security/site/docs/5.2.x/reference/html/oauth2.html#oauth2login-sample-redirect-uri</a></p>
  <p>In identity server , we get our client application registered and for code grant type, we tell that this would be our redirect URL i.e. <code>https://someserver:port/</code></p>
  <p>However, spring and other post suggests that to set redirect URI as <code>{baseUrl}/login/oauth2/code/{registrationId}</code>.</p>
  <p>I am confused if i have set redirect URI as <code>https://someserver:port/</code> in identity server , how <code>{baseUrl}/login/oauth2/code/{registrationId}</code> i.e. <code>https://someserver:port/login/oauth2/code/{registrationId}</code> will work.</p>
  <p>Should it not give invalid redirect URI?</p>