public class FacebookWebArgumentResolver extends Object implements WebArgumentResolver
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.UNRESOLVED
Constructor and Description |
---|
FacebookWebArgumentResolver(String appId,
String appSecret)
Construct a FacebookWebArgumentResolver given the Facebook app id and secret.
|
public FacebookWebArgumentResolver(String appId, String appSecret)
appId
- the application's Facebook App IDappSecret
- the application's Facebook App Secretpublic Object resolveArgument(MethodParameter parameter, NativeWebRequest request) throws Exception
resolveArgument
in interface WebArgumentResolver
Exception