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
,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
-
-
Constructor Summary
Constructors Constructor Description OAuthProfileDefinition()
OAuthProfileDefinition(org.pac4j.core.profile.factory.ProfileFactory profileFactory)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract org.pac4j.core.profile.CommonProfile
extractUserProfile(java.lang.String body)
Extract the user profile from the response (JSON, XML...) of the profile url.abstract java.lang.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
getProfileVerb()
Get HTTP Method to request profile.protected void
raiseProfileExtractionError(java.lang.String body)
Throws aTechnicalException
to indicate that user profile extraction has failed.protected void
raiseProfileExtractionJsonError(java.lang.String body)
Throws aTechnicalException
to indicate that user profile extraction has failed.protected void
raiseProfileExtractionJsonError(java.lang.String body, java.lang.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
-
-
-
-
Method Detail
-
getProfileVerb
public com.github.scribejava.core.model.Verb getProfileVerb()
Get HTTP Method to request profile.- Returns:
- http verb
-
getProfileUrl
public abstract java.lang.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
public abstract org.pac4j.core.profile.CommonProfile extractUserProfile(java.lang.String body)
Extract the user profile from the response (JSON, XML...) of the profile url.- Parameters:
body
- the response body- Returns:
- the returned profile
-
raiseProfileExtractionJsonError
protected void raiseProfileExtractionJsonError(java.lang.String body, java.lang.String missingNode)
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
protected void raiseProfileExtractionJsonError(java.lang.String body)
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
protected void raiseProfileExtractionError(java.lang.String body)
Throws aTechnicalException
to indicate that user profile extraction has failed.- Parameters:
body
- the request body that the user profile should have been extracted from
-
-