public class FacebookClient extends OAuth20Client<FacebookProfile>
This class is the OAuth client to authenticate users in Facebook.
By default, the following scope is requested to Facebook: user_likes, user_about_me, user_birthday, user_education_history, email, user_hometown, user_relationship_details, user_location, user_religion_politics, user_relationships, user_website and user_work_history.
The scope can be defined to require permissions from the user and retrieve fields from Facebook, by using the
setScope(String) method.
By default, the following fields are requested to Facebook: id, name, first_name, middle_name, last_name, gender, locale, languages, link, third_party_id, timezone, updated_time, verified, about, birthday, education, email, hometown, interested_in, location, political, favorite_athletes, favorite_teams, quotes, relationship_status, religion, significant_other, website and work.
The fields can be defined and requested to Facebook, by using the setFields(String) method.
The number of results can be limited by using the setLimit(int) method.
An extended access token can be requested by setting true on the setRequiresExtendedToken(boolean) method.
It returns a FacebookProfile.
More information at http://developers.facebook.com/docs/reference/api/user/
More information at https://developers.facebook.com/docs/howtos/login/extending-tokens/
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_FIELDS |
static java.lang.String |
DEFAULT_SCOPE |
protected java.lang.String |
fields |
protected int |
limit |
protected boolean |
requiresExtendedToken |
protected java.lang.String |
scope |
protected boolean |
useAppsecretProof |
configurationATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, urlResolverlogger| Constructor and Description |
|---|
FacebookClient() |
FacebookClient(java.lang.String key,
java.lang.String secret) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
clientInit(WebContext context) |
java.lang.String |
getFields() |
int |
getLimit() |
java.lang.String |
getScope() |
java.lang.String |
getStateData() |
boolean |
getUseAppSecretProof() |
boolean |
isRequiresExtendedToken() |
void |
setFields(java.lang.String fields) |
void |
setLimit(int limit) |
void |
setRequiresExtendedToken(boolean requiresExtendedToken) |
void |
setScope(java.lang.String scope) |
void |
setStateData(java.lang.String stateData) |
void |
setUseAppSecretProof(boolean useSecret) |
getConfiguration, getKey, getSecret, setConfiguration, setKey, setSecret, toStringcomputeFinalCallbackUrl, defaultLogoutActionBuilder, defaultRedirectActionBuilder, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCredentials, getLogoutAction, getLogoutActionBuilder, getRedirectAction, getRedirectActionBuilder, getUrlResolver, internalInit, isIncludeClientNameInCallbackUrl, redirect, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setIncludeClientNameInCallbackUrl, setLogoutActionBuilder, setRedirectActionBuilder, setUrlResolveraddAuthorizationGenerator, addAuthorizationGenerators, defaultAuthenticator, defaultCredentialsExtractor, defaultProfileCreator, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getName, getProfileCreator, getUserProfile, notifySessionRenewal, retrieveCredentials, retrieveUserProfile, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setName, setProfileCreatorinit, reinitpublic static final java.lang.String DEFAULT_FIELDS
protected java.lang.String fields
public static final java.lang.String DEFAULT_SCOPE
protected java.lang.String scope
protected int limit
protected boolean requiresExtendedToken
protected boolean useAppsecretProof
public FacebookClient()
public FacebookClient(java.lang.String key,
java.lang.String secret)
protected void clientInit(WebContext context)
clientInit in class OAuth20Client<FacebookProfile>public void setStateData(java.lang.String stateData)
public java.lang.String getStateData()
public void setUseAppSecretProof(boolean useSecret)
public boolean getUseAppSecretProof()
public java.lang.String getScope()
public void setScope(java.lang.String scope)
public java.lang.String getFields()
public void setFields(java.lang.String fields)
public int getLimit()
public void setLimit(int limit)
public boolean isRequiresExtendedToken()
public void setRequiresExtendedToken(boolean requiresExtendedToken)
Copyright © 2018. All Rights Reserved.