public class PayPalClient extends BaseOAuth20Client<PayPalProfile>
This class is the OAuth client to authenticate users in PayPal.
By default, the following scope is requested to PayPal : openid profile email address.
The scope can be defined to require permissions from the user and retrieve attributes from PayPal, by using the
setScope(String) method.
It returns a PayPalProfile.
More information at https://developer.paypal.com/webapps/developer/docs/integration/direct/log-in-with-paypal/detailed/
PayPalProfile| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_SCOPE |
protected String |
scope |
logger, OAUTH_CODEconnectTimeout, key, proxyHost, proxyPort, readTimeout, secret, service, tokenAsHeaderATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, NEEDS_CLIENT_REDIRECTION_PARAMETER| Constructor and Description |
|---|
PayPalClient() |
PayPalClient(String key,
String secret) |
| Modifier and Type | Method and Description |
|---|---|
protected PayPalProfile |
extractUserProfile(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.
|
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() |
protected PayPalClient |
newClient() |
protected boolean |
requiresStateParameter()
Return if this client requires a state parameter.
|
void |
setScope(String scope) |
getAccessToken, getOAuthCredentials, getStateParameter, isDirectRedirection, retrieveAuthorizationUrladdAccessTokenToProfile, clone, createProxyRequest, getConnectTimeout, getKey, getMechanism, getProxyHost, getProxyPort, getReadTimeout, getSecret, getUserProfile, isTokenAsHeader, retrieveCredentials, retrieveRedirectAction, retrieveUserProfile, retrieveUserProfileFromToken, sendRequestForData, sendRequestForData, setConnectTimeout, setKey, setProxyHost, setProxyPort, setReadTimeout, setSecret, setTokenAsHeaderaddAuthorizationGenerator, getAuthenticator, getAuthorizationGenerators, getCallbackUrl, getContextualCallbackUrl, getCredentials, getName, getProfileCreator, getRedirectAction, getRedirectionUrl, getUserProfile, isEnableContextualRedirects, isIncludeClientNameInCallbackUrl, prependHostToUrlIfNotPresent, redirect, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setCallbackUrl, setEnableContextualRedirects, setIncludeClientNameInCallbackUrl, setName, setProfileCreator, toStringinit, reinitpublic static final String DEFAULT_SCOPE
protected String scope
protected PayPalClient newClient()
newClient in class BaseClient<OAuthCredentials,PayPalProfile>protected void internalInit()
internalInit in class BaseOAuthClient<PayPalProfile>protected String getProfileUrl(org.scribe.model.Token accessToken)
BaseOAuthClientgetProfileUrl in class BaseOAuthClient<PayPalProfile>accessToken - only used when constructing dynamic urls from data in the tokenprotected PayPalProfile extractUserProfile(String body)
BaseOAuthClientextractUserProfile in class BaseOAuthClient<PayPalProfile>body - the response bodypublic String getScope()
public void setScope(String scope)
protected boolean requiresStateParameter()
BaseOAuth20ClientrequiresStateParameter in class BaseOAuth20Client<PayPalProfile>protected boolean hasBeenCancelled(WebContext context)
BaseOAuthClienthasBeenCancelled in class BaseOAuthClient<PayPalProfile>context - the web context.Copyright © 2015. All Rights Reserved.