public abstract class OAuthProfileDefinition<P extends CommonProfile,T extends com.github.scribejava.core.model.Token,O extends OAuthConfiguration> extends CommonProfileDefinition<P>
DISPLAY_NAME, EMAIL, FAMILY_NAME, FIRST_NAME, GENDER, LOCALE, LOCATION, PICTURE_URL, PROFILE_URL
logger, newProfile
Constructor and Description |
---|
OAuthProfileDefinition() |
OAuthProfileDefinition(Function<Object[],P> profileFactory) |
Modifier and Type | Method and Description |
---|---|
abstract P |
extractUserProfile(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.
|
abstract String |
getProfileUrl(T accessToken,
O 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(String body)
Throws a
TechnicalException to indicate that user profile extraction has failed. |
protected void |
raiseProfileExtractionJsonError(String body)
Throws a
TechnicalException to indicate that user profile extraction has failed. |
protected void |
raiseProfileExtractionJsonError(String body,
String missingNode)
Throws a
TechnicalException to indicate that user profile extraction has failed. |
convertAndAdd, convertAndAdd, getConverters, getPrimaryAttributes, getProfileId, getSecondaryAttributes, newProfile, primary, secondary, setProfileFactory, setProfileId
public com.github.scribejava.core.model.Verb getProfileVerb()
public abstract String getProfileUrl(T accessToken, O configuration)
accessToken
- only used when constructing dynamic urls from data in the tokenconfiguration
- the current configurationpublic abstract P extractUserProfile(String body)
body
- the response bodyprotected void raiseProfileExtractionJsonError(String body, String missingNode)
TechnicalException
to indicate that user profile extraction has failed.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 omittedprotected void raiseProfileExtractionJsonError(String body)
TechnicalException
to indicate that user profile extraction has failed.body
- the request body that the user profile should have been extracted fromprotected void raiseProfileExtractionError(String body)
TechnicalException
to indicate that user profile extraction has failed.body
- the request body that the user profile should have been extracted fromCopyright © 2019. All rights reserved.