Class OAuthProfileDefinition
java.lang.Object
org.pac4j.core.profile.definition.ProfileDefinition
org.pac4j.core.profile.definition.CommonProfileDefinition
org.pac4j.oauth.profile.definition.OAuthProfileDefinition
- Direct Known Subclasses:
BitbucketProfileDefinition
,CasOAuthWrapperProfileDefinition
,CronofyProfileDefinition
,DropBoxProfileDefinition
,FacebookProfileDefinition
,FigShareProfileDefinition
,FoursquareProfileDefinition
,GenericOAuth20ProfileDefinition
,GitHubProfileDefinition
,Google2ProfileDefinition
,HiOrgServerProfileDefinition
,LinkedIn2ProfileDefinition
,OkProfileDefinition
,PayPalProfileDefinition
,QQProfileDefinition
,StravaProfileDefinition
,TwitterProfileDefinition
,VkProfileDefinition
,WechatProfileDefinition
,WeiboProfileDefinition
,WindowsLiveProfileDefinition
,WordPressProfileDefinition
,YahooProfileDefinition
public abstract class OAuthProfileDefinition
extends org.pac4j.core.profile.definition.CommonProfileDefinition
OAuth profile definition.
- Since:
- 2.0.0
- Author:
- Jerome Leleu
-
Field Summary
Fields inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
DISPLAY_NAME, EMAIL, FAMILY_NAME, FIRST_NAME, GENDER, LOCALE, LOCATION, PICTURE_URL, PROFILE_URL
Fields inherited from class org.pac4j.core.profile.definition.ProfileDefinition
logger
-
Constructor Summary
ConstructorDescriptionOAuthProfileDefinition
(org.pac4j.core.profile.factory.ProfileFactory profileFactory) -
Method Summary
Modifier and TypeMethodDescriptionabstract org.pac4j.core.profile.CommonProfile
extractUserProfile
(String body) Extract the user profile from the response (JSON, XML...) of the profile url.abstract String
getProfileUrl
(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration) Retrieve the url of the profile of the authenticated user for the provider.com.github.scribejava.core.model.Verb
Get HTTP Method to request profile.protected void
Throws aTechnicalException
to indicate that user profile extraction has failed.protected void
Throws aTechnicalException
to indicate that user profile extraction has failed.protected void
raiseProfileExtractionJsonError
(String body, String missingNode) Throws aTechnicalException
to indicate that user profile extraction has failed.Methods inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
configurePrimaryAttributes
Methods inherited from class org.pac4j.core.profile.definition.ProfileDefinition
convertAndAdd, convertAndAdd, getConverters, getParameter, getPrimaryAttributes, getProfileId, getSecondaryAttributes, isRestoreProfileFromTypedId, newProfile, primary, secondary, setProfileFactory, setProfileId, setRestoreProfileFromTypedId
-
Constructor Details
-
OAuthProfileDefinition
public OAuthProfileDefinition() -
OAuthProfileDefinition
public OAuthProfileDefinition(org.pac4j.core.profile.factory.ProfileFactory profileFactory)
-
-
Method Details
-
getProfileVerb
public com.github.scribejava.core.model.Verb getProfileVerb()Get HTTP Method to request profile.- Returns:
- http verb
-
getProfileUrl
public abstract String getProfileUrl(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration) Retrieve the url of the profile of the authenticated user for the provider.- Parameters:
accessToken
- only used when constructing dynamic urls from data in the tokenconfiguration
- the current configuration- Returns:
- the url of the user profile given by the provider
-
extractUserProfile
Extract the user profile from the response (JSON, XML...) of the profile url.- Parameters:
body
- the response body- Returns:
- the returned profile
-
raiseProfileExtractionJsonError
Throws aTechnicalException
to indicate that user profile extraction has failed.- Parameters:
body
- the request body that the user profile should be have been extracted frommissingNode
- the name of a JSON node that was found missing. may be omitted
-
raiseProfileExtractionJsonError
Throws aTechnicalException
to indicate that user profile extraction has failed.- Parameters:
body
- the request body that the user profile should have been extracted from
-
raiseProfileExtractionError
Throws aTechnicalException
to indicate that user profile extraction has failed.- Parameters:
body
- the request body that the user profile should have been extracted from
-