Class FacebookClient
- All Implemented Interfaces:
org.pac4j.core.client.Client
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
FacebookConfiguration.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/
- Since:
- 1.0.0
- Author:
- Jerome Leleu, Mehdi BEN HAJ ABBES
-
Field Summary
Fields inherited from class org.pac4j.oauth.client.OAuth20Client
configuration
Fields inherited from class org.pac4j.core.client.IndirectClient
ATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, callbackUrlResolver, urlResolver
Fields inherited from class org.pac4j.core.client.BaseClient
logger, saveProfileInSession
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
getLimit()
getScope()
protected void
internalInit
(boolean forceReinit) void
void
setLimit
(int limit) void
Methods inherited from class org.pac4j.oauth.client.OAuth20Client
beforeInternalInit, getKey, getSecret, setKey, setSecret
Methods inherited from class org.pac4j.core.client.IndirectClient
afterInternalInit, computeFinalCallbackUrl, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCodeVerifierSessionAttributeName, getCredentials, getLogoutAction, getLogoutActionBuilder, getNonceSessionAttributeName, getRedirectionAction, getRedirectionActionBuilder, getStateSessionAttributeName, getUrlResolver, isCheckAuthenticationAttempt, newDefaultCallbackUrlResolver, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setCheckAuthenticationAttempt, setLogoutActionBuilder, setLogoutActionBuilderIfUndefined, setRedirectionActionBuilder, setRedirectionActionBuilderIfUndefined, setUrlResolver, toString
Methods inherited from class org.pac4j.core.client.BaseClient
addAuthorizationGenerator, addAuthorizationGenerators, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getCustomProperties, getLogger, getName, getProfileCreator, getProfileFactoryWhenNotAuthenticated, getSaveProfileInSession, getSaveProfileInSession, getUserProfile, isMultiProfile, isMultiProfile, notifySessionRenewal, renewUserProfile, retrieveCredentials, retrieveUserProfile, setAuthenticator, setAuthenticatorIfUndefined, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setCredentialsExtractorIfUndefined, setCustomProperties, setMultiProfile, setName, setProfileCreator, setProfileCreatorIfUndefined, setProfileFactoryWhenNotAuthenticated, setSaveProfileInSession
Methods inherited from class org.pac4j.core.util.InitializableObject
getInitialized, getLastAttempt, getMaxAttempts, getMinTimeIntervalBetweenAttemptsInMilliseconds, getNbAttempts, init, init, isInitialized, reinit, setMaxAttempts, setMinTimeIntervalBetweenAttemptsInMilliseconds, shouldInitialize
-
Constructor Details
-
FacebookClient
public FacebookClient() -
FacebookClient
-
-
Method Details
-
internalInit
protected void internalInit(boolean forceReinit) - Overrides:
internalInit
in classOAuth20Client
-
getConfiguration
-
getScope
-
setScope
-
getFields
-
setFields
-
getLimit
public int getLimit() -
setLimit
public void setLimit(int limit)
-