public class OAuth20ProfileCreator<U extends OAuth20Profile> extends InitializableWebObject
Modifier and Type | Field and Description |
---|---|
protected O |
configuration |
protected org.slf4j.Logger |
logger |
protected static com.fasterxml.jackson.databind.ObjectMapper |
mapper |
Constructor and Description |
---|
OAuth20ProfileCreator(OAuth20Configuration configuration) |
Modifier and Type | Method and Description |
---|---|
protected void |
addAccessTokenToProfile(U profile,
com.github.scribejava.core.model.OAuth2AccessToken accessToken)
Add the access token to the profile (as an attribute).
|
U |
create(C credentials,
WebContext context)
Create a profile from a credentials.
|
protected com.github.scribejava.core.model.OAuthRequest |
createOAuthRequest(String url,
com.github.scribejava.core.model.Verb verb)
Create an OAuth request.
|
protected com.github.scribejava.core.model.OAuth2AccessToken |
getAccessToken(OAuth20Credentials credentials)
Get the access token from OAuth credentials.
|
protected void |
internalInit(WebContext context)
Internal initialization of the object.
|
protected U |
retrieveUserProfileFromToken(T accessToken)
Retrieve the user profile from the access token.
|
protected String |
sendRequestForData(T accessToken,
String dataUrl,
com.github.scribejava.core.model.Verb verb)
Make a request to get the data of the authenticated user for the provider.
|
protected void |
signRequest(com.github.scribejava.core.model.OAuth2AccessToken accessToken,
com.github.scribejava.core.model.OAuthRequest request)
Sign the request.
|
String |
toString() |
init, reinit
protected final org.slf4j.Logger logger
protected static final com.fasterxml.jackson.databind.ObjectMapper mapper
protected final O extends OAuthConfiguration configuration
public OAuth20ProfileCreator(OAuth20Configuration configuration)
protected com.github.scribejava.core.model.OAuth2AccessToken getAccessToken(OAuth20Credentials credentials) throws HttpAction
credentials
- credentialsHttpAction
- whether an additional HTTP action is requiredprotected void addAccessTokenToProfile(U profile, com.github.scribejava.core.model.OAuth2AccessToken accessToken)
profile
- the user profileaccessToken
- the access tokenprotected void signRequest(com.github.scribejava.core.model.OAuth2AccessToken accessToken, com.github.scribejava.core.model.OAuthRequest request)
accessToken
- the tokenrequest
- the requestprotected void internalInit(WebContext context)
InitializableWebObject
internalInit
in class InitializableWebObject
context
- the web contextpublic U create(C credentials, WebContext context) throws HttpAction
ProfileCreator
create
in interface ProfileCreator<C extends OAuthCredentials,U extends CommonProfile>
credentials
- the given credentialscontext
- the web contextHttpAction
- whether an additional HTTP action is requiredprotected U retrieveUserProfileFromToken(T accessToken) throws HttpAction
accessToken
- the access tokenHttpAction
- whether an additional HTTP action is requiredprotected String sendRequestForData(T accessToken, String dataUrl, com.github.scribejava.core.model.Verb verb)
accessToken
- the access tokendataUrl
- url of the dataverb
- method used to request dataprotected com.github.scribejava.core.model.OAuthRequest createOAuthRequest(String url, com.github.scribejava.core.model.Verb verb)
url
- the url to callverb
- method used to create the requestCopyright © 2018. All rights reserved.