public class VkClient extends BaseOAuth20Client<VkProfile>
This class is the OAuth client to authenticate users in Vk.
The scope can be defined to require specific permissions from the user
by using the setScope(String) method. By default, the scope
is : PERMISSIONS.
It returns a VkProfile.
More information at https://vk.com/dev/users.get
VkProfile| Modifier and Type | Field and Description |
|---|---|
protected static String |
BASE_URL |
static String |
DEFAULT_FIELDS |
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 |
|---|
VkClient() |
VkClient(String key,
String secret) |
| Modifier and Type | Method and Description |
|---|---|
protected VkProfile |
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 VkClient |
newClient() |
void |
setFields(String fields) |
void |
setScope(String scope) |
getAccessToken, getOAuthCredentials, isDirectRedirection, retrieveAuthorizationUrladdAccessTokenToProfile, 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_FIELDS
protected String fields
public static final String DEFAULT_SCOPE
protected String scope
protected static final String BASE_URL
protected VkClient newClient()
newClient in class BaseClient<OAuthCredentials,VkProfile>protected void internalInit(WebContext context)
internalInit in class BaseOAuthClient<VkProfile>protected String getProfileUrl(org.scribe.model.Token accessToken)
BaseOAuthClientgetProfileUrl in class BaseOAuthClient<VkProfile>accessToken - only used when constructing dynamic urls from data in the tokenprotected VkProfile extractUserProfile(String body)
BaseOAuthClientextractUserProfile in class BaseOAuthClient<VkProfile>body - the response bodyprotected boolean hasBeenCancelled(WebContext context)
BaseOAuthClienthasBeenCancelled in class BaseOAuthClient<VkProfile>context - the web context.public String getScope()
public void setScope(String scope)
public String getFields()
public void setFields(String fields)
Copyright © 2016. All Rights Reserved.