org.springframework.social.facebook.web
Class FacebookWebArgumentResolver
java.lang.Object
org.springframework.social.facebook.web.FacebookWebArgumentResolver
- All Implemented Interfaces:
- WebArgumentResolver
public class FacebookWebArgumentResolver
- extends Object
- implements WebArgumentResolver
Web argument resolver that resolves arguments annotated with FacebookCookieValue
.
When using Facebook's JavaScript API, the FB.init() call will set a cookie whose name is "fbs_{appId}" if the user is signed into Facebook and if
they have granted the application permission to access their profile.
This web argument resolver extracts that information from the cookie (if available) and supplies it to a controller handler method as String values.
FacebookCookieValue
is required by default. If the cookie value cannot be resolved and if the annotation is set to be
required, an exception will be thrown indicating an illegal state. If the annotation is set to not be required, null will be returned.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FacebookWebArgumentResolver
public FacebookWebArgumentResolver(String appId,
String appSecret)
- Construct a FacebookWebArgumentResolver given the Facebook app id and secret.
The application secret will be used to verify the cookie signature.
resolveArgument
public Object resolveArgument(MethodParameter parameter,
NativeWebRequest request)
throws Exception
- Specified by:
resolveArgument
in interface WebArgumentResolver
- Throws:
Exception