-
Notifications
You must be signed in to change notification settings - Fork 703
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
issue (and fix) for facebook login #2
Comments
<3 |
@sellum The problem is related to "Strict mode" on facebook login, since we defined "redirectUriTemplate" its make requests using http (without httpS) and facebook blocks.
on SecurityConfig.java - .antMatchers("/auth/**", "/oauth2/**")
+ .antMatchers("/auth/**", "/oauth2/**", "/login/**")
...
- .baseUri("/oauth2/authorize")
+ .baseUri("/login/oauth2/authorize")
...
- .baseUri("/oauth2/callback/*")
+ .baseUri("/login/oauth2/code/*") on application.yaml, remove redirectUriTemplate and add server.use-forward-headers - redirectUriTemplate: "{baseUrl}/oauth2/callback/{registrationId}" (both)
.....
+server:
+ use-forward-headers: true you need to update React's constants src\constants\index.js + export const GOOGLE_AUTH_URL =
API_BASE_URL + "/login/oauth2/authorize/google?redirect_uri=" + OAUTH2_REDIRECT_URI;
+ export const FACEBOOK_AUTH_URL =
API_BASE_URL +
"/login/oauth2/authorize/facebook?redirect_uri=" +
OAUTH2_REDIRECT_URI; and I used ngrok to tunneling https (localhost) |
@maiconcarraro , can you please share a working example for the Facebook login? |
Using this in the pom.xml, should fix the issue <spring-security.version>5.2.0.RELEASE</spring-security.version> |
Those who are using nginx reverse proxy, can add the following in your
and your nginx configuration should be
|
I finally succeeded to resolve this problem thank's to @Grauzone's pull-request
And then replace |
Once I hit and get past Facebook page and I get this error. Anyone came through this issue? |
hey thanks a lot man, such a nice and clean example, it worked really well.
i had an issue with facebook login throwing
invalid_user_info_response] An error occurred while attempting to retrieve the UserInfo Resource: Could not extract response: no suitable HttpMessageConverter found for response type [java.util.Map<java.lang.String, java.lang.Object>] and content type [text/javascript;charset=UTF-8]
here is the fix in case you or other people want to patch:
this is documented here:
spring-projects/spring-security#6017
so the fix is also described in that link, but to summarize:
add the following additional repository in pom:
Add the following PROPERTY:
<spring-security.version>5.1.2.BUILD-SNAPSHOT</spring-security.version>
Here is the full reference of my pom that fixed that issue:
4.0.0
The text was updated successfully, but these errors were encountered: