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
Modifier and TypeFieldDescriptionstatic final String
ConstantAVATAR_URL="avatar_url"
static final String
ConstantBIO="bio"
static final String
ConstantBLOG="blog"
static final String
ConstantCOLLABORATORS="collaborators"
static final String
ConstantCOMPANY="company"
static final String
ConstantCREATED_AT="created_at"
static final String
ConstantDISK_USAGE="disk_usage"
static final String
ConstantFOLLOWERS="followers"
static final String
ConstantFOLLOWING="following"
static final String
ConstantGRAVATAR_ID="gravatar_id"
static final String
ConstantHIREABLE="hireable"
static final String
ConstantHTML_URL="html_url"
static final String
ConstantLOGIN="login"
static final String
ConstantNAME="name"
static final String
ConstantOWNED_PRIVATE_REPOS="owned_private_repos"
static final String
ConstantPLAN="plan"
static final String
ConstantPRIVATE_GISTS="private_gists"
static final String
ConstantPUBLIC_GISTS="public_gists"
static final String
ConstantPUBLIC_REPOS="public_repos"
static final String
ConstantTOTAL_PRIVATE_REPOS="total_private_repos"
static final String
ConstantTYPE="type"
static final String
ConstantUPDATED_AT="updated_at"
static final String
ConstantURL="url"
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
-
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, raiseProfileExtractionJsonError
Methods inherited from class org.pac4j.core.profile.definition.CommonProfileDefinition
configurePrimaryAttributes
Methods 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:
getProfileUrl
in 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:
extractUserProfile
in classOAuthProfileDefinition
- Parameters:
body
- the response body- Returns:
- the returned profile
-