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(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.
|
String |
getFirstNodePath() |
Map<String,String> |
getProfileAttributes() |
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(String name,
AttributeConverter<? extends Object> converter)
Add an attribute as a primary one and its converter.
|
void |
profileAttribute(String name,
String tag,
AttributeConverter<? extends Object> converter)
Add an attribute as a primary one and its converter.
|
void |
setFirstNodePath(String firstNodePath) |
void |
setProfileUrl(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(String profileUrl)
public 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(String body)
OAuthProfileDefinitionextractUserProfile in class OAuthProfileDefinition<OAuth20Profile,com.github.scribejava.core.model.OAuth2AccessToken,OAuth20Configuration>body - the response bodypublic void profileAttribute(String name, AttributeConverter<? extends Object> converter)
name - name of the attributeconverter - converterpublic void profileAttribute(String name, String tag, AttributeConverter<? extends Object> converter)
name - name of the attributetag - json referenceconverter - converterpublic String getFirstNodePath()
public void setFirstNodePath(String firstNodePath)
Copyright © 2018. All rights reserved.