Auto-tuning Spring Socials ConnectController not working

I followed the steps on this site to create a simple spring boot application that accesses facebook data using maven and spring boot.

http://spring.io/guides/gs/accessing-facebook/

which also matches http://www.technicalkeeda.com/spring/spring-social-facebook-integration-example , but in gradle.

The problem I am facing is when I try to run the application, I see that the URL was successfully redirected to "/ connect / facebook", but it does not load facebookConnect.html, instead it gives an error as shown below:

" Whitelabel Error Page

This application does not have an explicit mapping for / error, so you see this as a fallback.

Tue 10 Mar 19:24:41 IST 2015

An unexpected error occurred (type = method not allowed, status = 405). GET request method not supported "

I also tried to use the same code listed on the site, and also used my facebook and appSecret applications in it, which I created by providing a random hostname in the facebook application, but still getting the same error.

I also tried adding an arbitrary hostname that I created in the / etc / hosts file in the windows.

Can someone please help me, why can't I see the .html page that ConnectController should automatically display?

0
spring spring-boot spring-mvc spring-social spring-social-facebook
source share
2 answers

I finally got a response. we need an additional parameter in the application.properties file, which

" spring.social.auto_connection_views = true

along with an identifier and a secret.

spring.social.facebook.appId =

spring.social.facebook.appSecret =

this property was not mentioned in textbooks. finally it worked. :) "

+3
source share

There was the same problem. spring.social.auto-connection-views: true in application.yml (or the .parameter equivalent) really solves it, but then the default values facebookConnect.html and facebookConnected.html .

I solved this by removing the above application parameter and simply adding the Thymeleaf alluring engine to pom.xml :

 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-thymeleaf</artifactId> </dependency> 

And then you can use your own facebookConnect.html and facebookConnected.html located in src/main/resources/templates/connect/

Hope this helps.

0
source share

All Articles