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
-
public class GitHubProfileDefinition extends OAuthProfileDefinition
This class is the GitHub profile definition.- Since:
- 1.1.0
- Author:
- Jerome Leleu
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringAVATAR_URLstatic java.lang.StringBIOstatic java.lang.StringBLOGstatic java.lang.StringCOLLABORATORSstatic java.lang.StringCOMPANYstatic java.lang.StringCREATED_ATstatic java.lang.StringDISK_USAGEstatic java.lang.StringFOLLOWERSstatic java.lang.StringFOLLOWINGstatic java.lang.StringGRAVATAR_IDstatic java.lang.StringHIREABLEstatic java.lang.StringHTML_URLstatic java.lang.StringLOGINstatic java.lang.StringNAMEstatic java.lang.StringOWNED_PRIVATE_REPOSstatic java.lang.StringPLANstatic java.lang.StringPRIVATE_GISTSstatic java.lang.StringPUBLIC_GISTSstatic java.lang.StringPUBLIC_REPOSstatic java.lang.StringTOTAL_PRIVATE_REPOSstatic java.lang.StringTYPEstatic java.lang.StringUPDATED_ATstatic java.lang.StringURL
-
Constructor Summary
Constructors Constructor Description GitHubProfileDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GitHubProfileextractUserProfile(java.lang.String body)Extract the user profile from the response (JSON, XML...) of the profile url.java.lang.StringgetProfileUrl(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, getParameter, getPrimaryAttributes, getProfileId, getSecondaryAttributes, isRestoreProfileFromTypedId, newProfile, primary, secondary, setProfileFactory, setProfileId, setRestoreProfileFromTypedId
-
-
-
-
Field Detail
-
TYPE
public static final java.lang.String TYPE
- See Also:
- Constant Field Values
-
BLOG
public static final java.lang.String BLOG
- See Also:
- Constant Field Values
-
URL
public static final java.lang.String URL
- See Also:
- Constant Field Values
-
PUBLIC_GISTS
public static final java.lang.String PUBLIC_GISTS
- See Also:
- Constant Field Values
-
FOLLOWING
public static final java.lang.String FOLLOWING
- See Also:
- Constant Field Values
-
PRIVATE_GISTS
public static final java.lang.String PRIVATE_GISTS
- See Also:
- Constant Field Values
-
PUBLIC_REPOS
public static final java.lang.String PUBLIC_REPOS
- See Also:
- Constant Field Values
-
GRAVATAR_ID
public static final java.lang.String GRAVATAR_ID
- See Also:
- Constant Field Values
-
AVATAR_URL
public static final java.lang.String AVATAR_URL
- See Also:
- Constant Field Values
-
FOLLOWERS
public static final java.lang.String FOLLOWERS
- See Also:
- Constant Field Values
-
LOGIN
public static final java.lang.String LOGIN
- See Also:
- Constant Field Values
-
COMPANY
public static final java.lang.String COMPANY
- See Also:
- Constant Field Values
-
HIREABLE
public static final java.lang.String HIREABLE
- See Also:
- Constant Field Values
-
COLLABORATORS
public static final java.lang.String COLLABORATORS
- See Also:
- Constant Field Values
-
HTML_URL
public static final java.lang.String HTML_URL
- See Also:
- Constant Field Values
-
BIO
public static final java.lang.String BIO
- See Also:
- Constant Field Values
-
TOTAL_PRIVATE_REPOS
public static final java.lang.String TOTAL_PRIVATE_REPOS
- See Also:
- Constant Field Values
-
CREATED_AT
public static final java.lang.String CREATED_AT
- See Also:
- Constant Field Values
-
UPDATED_AT
public static final java.lang.String UPDATED_AT
- See Also:
- Constant Field Values
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
DISK_USAGE
public static final java.lang.String DISK_USAGE
- See Also:
- Constant Field Values
-
PLAN
public static final java.lang.String PLAN
- See Also:
- Constant Field Values
-
OWNED_PRIVATE_REPOS
public static final java.lang.String OWNED_PRIVATE_REPOS
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProfileUrl
public java.lang.String getProfileUrl(com.github.scribejava.core.model.Token accessToken, OAuthConfiguration configuration)Description copied from class:OAuthProfileDefinitionRetrieve 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
public GitHubProfile extractUserProfile(java.lang.String body)
Description copied from class:OAuthProfileDefinitionExtract 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
-
-