Package org.pac4j.oauth.profile.google2
Class Google2ProfileDefinition
- java.lang.Object
-
- org.pac4j.core.profile.definition.ProfileDefinition<P>
-
- org.pac4j.core.profile.definition.CommonProfileDefinition<P>
-
- org.pac4j.oauth.profile.definition.OAuthProfileDefinition<P,com.github.scribejava.core.model.OAuth2AccessToken,C>
-
- org.pac4j.oauth.profile.definition.OAuth20ProfileDefinition<Google2Profile,OAuth20Configuration>
-
- org.pac4j.oauth.profile.google2.Google2ProfileDefinition
-
public class Google2ProfileDefinition extends OAuth20ProfileDefinition<Google2Profile,OAuth20Configuration>
This class is the Google profile definition (using OAuth 2.0 protocol).- Since:
- 1.2.0
- Author:
- Jerome Leleu
-
-
Field Summary
Fields Modifier and Type Field Description static String
EMAIL_VERIFIED
static String
GIVEN_NAME
static String
NAME
static String
PICTURE
static String
PROFILE
-
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, newProfile
-
-
Constructor Summary
Constructors Constructor Description Google2ProfileDefinition()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Google2Profile
extractUserProfile(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.String
getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OAuth20Configuration 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, getPrimaryAttributes, getProfileId, getSecondaryAttributes, newProfile, primary, secondary, setProfileFactory, setProfileId
-
-
-
-
Field Detail
-
EMAIL_VERIFIED
public static final String EMAIL_VERIFIED
- See Also:
- Constant Field Values
-
GIVEN_NAME
public static final String GIVEN_NAME
- See Also:
- Constant Field Values
-
NAME
public static final String NAME
- See Also:
- Constant Field Values
-
PICTURE
public static final String PICTURE
- See Also:
- Constant Field Values
-
PROFILE
public static final String PROFILE
- See Also:
- Constant Field Values
-
-
Method Detail
-
getProfileUrl
public String getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken, OAuth20Configuration configuration)
Description copied from class:OAuthProfileDefinition
Retrieve the url of the profile of the authenticated user for the provider.- Specified by:
getProfileUrl
in classOAuthProfileDefinition<Google2Profile,com.github.scribejava.core.model.OAuth2AccessToken,OAuth20Configuration>
- 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 Google2Profile extractUserProfile(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<Google2Profile,com.github.scribejava.core.model.OAuth2AccessToken,OAuth20Configuration>
- Parameters:
body
- the response body- Returns:
- the returned profile
-
-