我已经使用 spring social facebook api 将我的应用程序与 facebook 连接起来。我尝试使用以下方式获取所有组
FacebookTemplate facebookTemplate = new FacebookTemplate();
List<Group> group = facebookTemplate.fetchConnections("me", "groups", Group.class);
但它会生成以下错误消息
org.springframework.social.MissingAuthorizationException: Authorization is required for the operation, but the API binding was created without authorization.
org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleFacebookError(FacebookErrorHandler.java:95)
org.springframework.social.facebook.api.impl.FacebookErrorHandler.handleError(FacebookErrorHandler.java:60)
org.springframework.web.client.RestTemplate.handleResponseError(RestTemplate.java:486)
org.springframework.web.client.RestTemplate.doExecute(RestTemplate.java:443)
org.springframework.web.client.RestTemplate.execute(RestTemplate.java:415)
org.springframework.web.client.RestTemplate.getForObject(RestTemplate.java:213)
org.springframework.social.facebook.api.impl.FacebookTemplate.fetchConnections(FacebookTemplate.java:180)
org.springframework.social.facebook.api.impl.FacebookTemplate.fetchConnections(FacebookTemplate.java:174)
com.horoppa.social.facebook.FacebookFeedController.postUpdate(FacebookFeedController.java:52)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
It may be required to create FacebookTemplate object using AccessToken for authorization.
FacebookTemplate facebookTemplate = new FacebookTemplate(AccessToken);
请帮助我,如何获取 accessToken 以及如何获取所有组。