我需要从 Spring Social API 获取访问 token 才能执行 API 未提供的操作。
例如将消息推送到客户端通知图标。
我通过 Spring 官方文档关注了 spring 社交 Facebook:
https://github.com/spring-guides/gs-accessing-facebook
如何使用 API 来获取访问 token 字符串?
谢谢。
最佳答案
目前没有办法直接获取访问 token 。相反,Facebook 接口(interface)提供了一个restOperations() 方法,该方法将为您提供一个RestTemplate 实例,该实例经过检测可以自动将Authorization header 添加到每个请求上。您应该能够通过授权的 RestTemplate 实例访问整个 Facebook API。
关于java - 使用 Spring Social facebook api 获取访问 token ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27171629/