You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if (request.getServerName().equals("localhost") && request.getHeader("host") != null) {
UriComponents uri = UriComponentsBuilder.fromHttpRequest(new ServletServerHttpRequest(request))
.host("127.0.0.1").build();
response.sendRedirect(uri.toUriString());
return;
}
In the oauth2 of Google login and GitHub login, there will be a prompt error that the callback address is different from the callback address configured by the application, and an error will be reported.
Because Google login does not allow setting the callback URL of 127.0.0.1, it needs a domain name, similar to localhost, but LoopbackIpRedirectFilter will change it to 127.0.0.1
The text was updated successfully, but these errors were encountered:
With facebook login it also happens that https is mandatory in the redirect uri, except for localhost.
Removing this filter and using localhost and http for the demo works for the facebook login.
\spring-security-samples\servlet\spring-boot\java\oauth2\login\src\main\java\example\filter\LoopbackIpRedirectFilter.java
Should not be configured:
if (request.getServerName().equals("localhost") && request.getHeader("host") != null) {
UriComponents uri = UriComponentsBuilder.fromHttpRequest(new ServletServerHttpRequest(request))
.host("127.0.0.1").build();
response.sendRedirect(uri.toUriString());
return;
}
In the oauth2 of Google login and GitHub login, there will be a prompt error that the callback address is different from the callback address configured by the application, and an error will be reported.
Because Google login does not allow setting the callback URL of 127.0.0.1, it needs a domain name, similar to localhost, but LoopbackIpRedirectFilter will change it to 127.0.0.1
The text was updated successfully, but these errors were encountered: