Package org.pac4j.oauth.profile.github
Class GitHubProfileDefinition
java.lang.Object
org.pac4j.core.profile.definition.ProfileDefinition
org.pac4j.core.profile.definition.CommonProfileDefinition
org.pac4j.oauth.profile.definition.OAuthProfileDefinition
org.pac4j.oauth.profile.github.GitHubProfileDefinition
This class is the GitHub profile definition.
- Since:
- 1.1.0
- Author:
- Jerome Leleu
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringConstantAVATAR_URL="avatar_url"static final StringConstantBIO="bio"static final StringConstantBLOG="blog"static final StringConstantCOLLABORATORS="collaborators"static final StringConstantCOMPANY="company"static final StringConstantCREATED_AT="created_at"static final StringConstantDISK_USAGE="disk_usage"static final StringConstantFOLLOWERS="followers"static final StringConstantFOLLOWING="following"static final StringConstantGRAVATAR_ID="gravatar_id"static final StringConstantHIREABLE="hireable"static final StringConstantHTML_URL="html_url"static final StringConstantLOGIN="login"static final StringConstantNAME="name"static final StringConstantOWNED_PRIVATE_REPOS="owned_private_repos"static final StringConstantPLAN="plan"static final StringConstantPRIVATE_GISTS="private_gists"static final StringConstantPUBLIC_GISTS="public_gists"static final StringConstantPUBLIC_REPOS="public_repos"static final StringConstantTOTAL_PRIVATE_REPOS="total_private_repos"static final StringConstantTYPE="type"static final StringConstantUPDATED_AT="updated_at"static final StringConstantURL="url"Fields inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
DISPLAY_NAME, EMAIL, FAMILY_NAME, FIRST_NAME, GENDER, LOCALE, LOCATION, PICTURE_URL, PROFILE_URLFields inherited from class org.pac4j.core.profile.definition.ProfileDefinition
logger -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractUserProfile(String body) Extract the user profile from the response (JSON, XML...) of the profile url.getProfileUrl(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration) Retrieve the url of the profile of the authenticated user for the provider.Methods inherited from class org.pac4j.oauth.profile.definition.OAuthProfileDefinition
getProfileVerb, raiseProfileExtractionError, raiseProfileExtractionJsonError, raiseProfileExtractionJsonErrorMethods inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
configurePrimaryAttributesMethods inherited from class org.pac4j.core.profile.definition.ProfileDefinition
convertAndAdd, convertAndAdd, getConverters, getLogger, getParameter, getPrimaryAttributes, getProfileFactory, getProfileId, getSecondaryAttributes, isRestoreProfileFromTypedId, newProfile, primary, secondary, setProfileFactory, setProfileId, setRestoreProfileFromTypedId
-
Field Details
-
TYPE
ConstantTYPE="type"- See Also:
-
BLOG
ConstantBLOG="blog"- See Also:
-
URL
ConstantURL="url"- See Also:
-
PUBLIC_GISTS
ConstantPUBLIC_GISTS="public_gists"- See Also:
-
FOLLOWING
ConstantFOLLOWING="following"- See Also:
-
PRIVATE_GISTS
ConstantPRIVATE_GISTS="private_gists"- See Also:
-
PUBLIC_REPOS
ConstantPUBLIC_REPOS="public_repos"- See Also:
-
GRAVATAR_ID
ConstantGRAVATAR_ID="gravatar_id"- See Also:
-
AVATAR_URL
ConstantAVATAR_URL="avatar_url"- See Also:
-
FOLLOWERS
ConstantFOLLOWERS="followers"- See Also:
-
LOGIN
ConstantLOGIN="login"- See Also:
-
COMPANY
ConstantCOMPANY="company"- See Also:
-
HIREABLE
ConstantHIREABLE="hireable"- See Also:
-
COLLABORATORS
ConstantCOLLABORATORS="collaborators"- See Also:
-
HTML_URL
ConstantHTML_URL="html_url"- See Also:
-
BIO
ConstantBIO="bio"- See Also:
-
TOTAL_PRIVATE_REPOS
ConstantTOTAL_PRIVATE_REPOS="total_private_repos"- See Also:
-
CREATED_AT
ConstantCREATED_AT="created_at"- See Also:
-
UPDATED_AT
ConstantUPDATED_AT="updated_at"- See Also:
-
NAME
ConstantNAME="name"- See Also:
-
DISK_USAGE
ConstantDISK_USAGE="disk_usage"- See Also:
-
PLAN
ConstantPLAN="plan"- See Also:
-
OWNED_PRIVATE_REPOS
ConstantOWNED_PRIVATE_REPOS="owned_private_repos"- See Also:
-
-
Constructor Details
-
GitHubProfileDefinition
public GitHubProfileDefinition()Constructor for GitHubProfileDefinition.
-
-
Method Details
-
getProfileUrl
public String getProfileUrl(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration) Retrieve the url of the profile of the authenticated user for the provider.- Specified by:
getProfileUrlin classOAuthProfileDefinition- 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.- Specified by:
extractUserProfilein classOAuthProfileDefinition- Parameters:
body- the response body- Returns:
- the returned profile
-