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.String
AVATAR_URL
static java.lang.String
BIO
static java.lang.String
BLOG
static java.lang.String
COLLABORATORS
static java.lang.String
COMPANY
static java.lang.String
CREATED_AT
static java.lang.String
DISK_USAGE
static java.lang.String
FOLLOWERS
static java.lang.String
FOLLOWING
static java.lang.String
GRAVATAR_ID
static java.lang.String
HIREABLE
static java.lang.String
HTML_URL
static java.lang.String
LOGIN
static java.lang.String
NAME
static java.lang.String
OWNED_PRIVATE_REPOS
static java.lang.String
PLAN
static java.lang.String
PRIVATE_GISTS
static java.lang.String
PUBLIC_GISTS
static java.lang.String
PUBLIC_REPOS
static java.lang.String
TOTAL_PRIVATE_REPOS
static java.lang.String
TYPE
static java.lang.String
UPDATED_AT
static java.lang.String
URL
-
Constructor Summary
Constructors Constructor Description GitHubProfileDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GitHubProfile
extractUserProfile(java.lang.String body)
Extract the user profile from the response (JSON, XML...) of the profile url.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.-
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:OAuthProfileDefinition
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
public GitHubProfile extractUserProfile(java.lang.String body)
Description copied from class:OAuthProfileDefinition
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
-
-