public class LinkedIn2Client extends BaseOAuth20StateClient<LinkedIn2Profile>
This class is the OAuth client to authenticate users in LinkedIn (using OAuth 2.0 protocol).
It returns a LinkedIn2Profile.
The scope (by default : r_fullprofile) can be specified using the setScope(String) method, as well as the returned
fields through the setFields(String) method.
More information at https://developer.linkedin.com/documents/profile-api
LinkedIn2Profile| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SCOPE |
protected String |
fields |
protected String |
scope |
logger, OAUTH_CODEconnectTimeout, key, proxyHost, proxyPort, readTimeout, secret, service, tokenAsHeaderATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, callbackUrlResolver, NEEDS_CLIENT_REDIRECTION_PARAMETER| Constructor and Description |
|---|
LinkedIn2Client() |
LinkedIn2Client(String key,
String secret) |
| Modifier and Type | Method and Description |
|---|---|
protected LinkedIn2Profile |
extractUserProfile(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.
|
String |
getFields() |
protected String |
getProfileUrl(org.scribe.model.Token accessToken)
Retrieve the url of the profile of the authenticated user for the provider.
|
String |
getScope() |
protected boolean |
hasBeenCancelled(WebContext context)
Return if the authentication has been cancelled.
|
protected void |
internalInit(WebContext context) |
protected LinkedIn2Client |
newClient() |
void |
setFields(String fields) |
void |
setScope(String scope) |
getAuthorizationUrl, getOAuthCredentials, getState, retrieveAuthorizationUrl, setStategetAccessToken, isDirectRedirectionaddAccessTokenToProfile, clone, createProxyRequest, getClientType, getConnectTimeout, getKey, getProxyHost, getProxyPort, getReadTimeout, getSecret, getUserProfile, isTokenAsHeader, retrieveCredentials, retrieveRedirectAction, retrieveUserProfile, retrieveUserProfileFromToken, sendRequestForData, sendRequestForData, setConnectTimeout, setKey, setProxyHost, setProxyPort, setReadTimeout, setSecret, setTokenAsHeadercomputeFinalCallbackUrl, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCredentials, getRedirectAction, getRedirectionUrl, getStateParameter, isIncludeClientNameInCallbackUrl, redirect, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setIncludeClientNameInCallbackUrladdAuthorizationGenerator, getAuthorizationGenerators, getName, getUserProfile, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setName, toStringinit, reinitpublic static final String DEFAULT_SCOPE
protected String scope
protected String fields
protected LinkedIn2Client newClient()
newClient in class BaseClientprotected void internalInit(WebContext context)
internalInit in class BaseOAuthClientprotected boolean hasBeenCancelled(WebContext context)
BaseOAuthClienthasBeenCancelled in class BaseOAuthClientcontext - the web context.protected String getProfileUrl(org.scribe.model.Token accessToken)
BaseOAuthClientgetProfileUrl in class BaseOAuthClientaccessToken - only used when constructing dynamic urls from data in the tokenprotected LinkedIn2Profile extractUserProfile(String body)
BaseOAuthClientextractUserProfile in class BaseOAuthClientbody - the response bodypublic String getScope()
public void setScope(String scope)
public String getFields()
public void setFields(String fields)
Copyright © 2016. All Rights Reserved.