public class GenericOAuth20ProfileDefinition extends OAuth20ProfileDefinition<OAuth20Profile,OAuth20Configuration>
This class is the user profile for generic OAuth2 with appropriate getters.
The map of profileAttributes is intended to replate the primary/secondary attributes where
the key is the name of the attribute and the value is the path to obtain that attribute from the
json resopnse, starting from firstNodePath
DISPLAY_NAME, EMAIL, FAMILY_NAME, FIRST_NAME, GENDER, LOCALE, LOCATION, PICTURE_URL, PROFILE_URLlogger, newProfile| Constructor and Description |
|---|
GenericOAuth20ProfileDefinition() |
| Modifier and Type | Method and Description |
|---|---|
OAuth20Profile |
extractUserProfile(java.lang.String body)
Extract the user profile from the response (JSON, XML...) of the profile url.
|
java.lang.String |
getFirstNodePath() |
java.util.Map<java.lang.String,java.lang.String> |
getProfileAttributes() |
java.lang.String |
getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken,
OAuth20Configuration configuration)
Retrieve the url of the profile of the authenticated user for the provider.
|
com.github.scribejava.core.model.Verb |
getProfileVerb()
Get HTTP Method to request profile.
|
void |
profileAttribute(java.lang.String name,
AttributeConverter<? extends java.lang.Object> converter)
Add an attribute as a primary one and its converter.
|
void |
profileAttribute(java.lang.String name,
java.lang.String tag,
AttributeConverter<? extends java.lang.Object> converter)
Add an attribute as a primary one and its converter.
|
void |
setFirstNodePath(java.lang.String firstNodePath) |
void |
setProfileUrl(java.lang.String profileUrl) |
void |
setProfileVerb(com.github.scribejava.core.model.Verb value) |
convertAndAdd, convertAndAdd, getConverters, getPrimaryAttributes, getProfileId, getSecondaryAttributes, newProfile, primary, secondary, setProfileFactory, setProfileIdpublic void setProfileVerb(com.github.scribejava.core.model.Verb value)
public com.github.scribejava.core.model.Verb getProfileVerb()
OAuthProfileDefinitiongetProfileVerb in class OAuthProfileDefinition<OAuth20Profile,com.github.scribejava.core.model.OAuth2AccessToken,OAuth20Configuration>public void setProfileUrl(java.lang.String profileUrl)
public java.lang.String getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken,
OAuth20Configuration configuration)
OAuthProfileDefinitiongetProfileUrl in class OAuthProfileDefinition<OAuth20Profile,com.github.scribejava.core.model.OAuth2AccessToken,OAuth20Configuration>accessToken - only used when constructing dynamic urls from data in the tokenconfiguration - the current configurationpublic OAuth20Profile extractUserProfile(java.lang.String body)
OAuthProfileDefinitionextractUserProfile in class OAuthProfileDefinition<OAuth20Profile,com.github.scribejava.core.model.OAuth2AccessToken,OAuth20Configuration>body - the response bodypublic java.util.Map<java.lang.String,java.lang.String> getProfileAttributes()
public void profileAttribute(java.lang.String name,
AttributeConverter<? extends java.lang.Object> converter)
name - name of the attributeconverter - converterpublic void profileAttribute(java.lang.String name,
java.lang.String tag,
AttributeConverter<? extends java.lang.Object> converter)
name - name of the attributetag - json referenceconverter - converterpublic java.lang.String getFirstNodePath()
public void setFirstNodePath(java.lang.String firstNodePath)
Copyright © 2018. All Rights Reserved.