I'm using spring-social-facebook
and sometimes, after some time the authentication seems to expire and I get this exception:
org.springframework.social.ExpiredAuthorizationException: The authorization has expired.
at org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleFacebookError(FacebookErrorHandler.java:83)
at org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleError(FacebookErrorHandler.java:59)
at org.springframework.web.client.RestTemplate.handleResponse(RestTemplate.java:667)
at org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:620)
at org.springframework.web.client.RestTemplate.execute(RestTemplate.java:595)
at org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:303)
at org.springframework.social.facebook.api.impl.SocialContextTemplate.getSocialContext(SocialContextTemplate.java:120)
I don't know how to handle with this error...Would it be possible to automatically reconnect after the authentication expires?
Versions used:
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-facebook</artifactId>
<version>2.0.4.BUILD-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.springframework.social</groupId>
<artifactId>spring-social-core</artifactId>
<version>1.1.4.RELEASE</version>
</dependency>
I've found similar questions in SO:
- How to handle ExpiredAuthorizationException happening in spring social facebook? I think this solution doesn't work with my newer versions.
- How to recover from a Spring Social ExpiredAuthorizationException:This solution only works for the spring-social-google particular case.
Any help would be apreciated.