public class GitHubClient extends BaseOAuth20Client<GitHubProfile>
setScope(String) method. By default,
the scope is : user.
It returns a GitHubProfile.
More information at http://developer.github.com/v3/users/GitHubProfile| 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 |
|---|
GitHubClient() |
GitHubClient(String key,
String secret) |
| Modifier and Type | Method and Description |
|---|---|
protected GitHubProfile |
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 GitHubClient |
newClient() |
protected boolean |
requiresStateParameter()
Return if this client requires a state parameter.
|
void |
setScope(String scope) |
getAccessToken, getOAuthCredentials, isDirectRedirection, retrieveAuthorizationUrladdAccessTokenToProfile, clone, createProxyRequest, getConnectTimeout, getKey, getProtocol, getProxyHost, getProxyPort, getReadTimeout, getSecret, getUserProfile, isTokenAsHeader, retrieveCredentials, retrieveRedirectAction, retrieveUserProfile, retrieveUserProfileFromToken, sendRequestForData, sendRequestForData, setConnectTimeout, setKey, setProxyHost, setProxyPort, setReadTimeout, setSecret, setTokenAsHeaderaddAuthorizationGenerator, getAuthorizationGenerators, getCallbackUrl, getContextualCallbackUrl, getCredentials, getName, getRedirectAction, getRedirectionUrl, getUserProfile, isEnableContextualRedirects, prependHostToUrlIfNotPresent, redirect, setAuthorizationGenerator, setAuthorizationGenerators, setCallbackUrl, setEnableContextualRedirects, setName, toStringinit, reinitpublic static final String DEFAULT_SCOPE
protected String scope
protected GitHubClient newClient()
newClient in class BaseClient<OAuthCredentials,GitHubProfile>protected void internalInit()
internalInit in class BaseOAuthClient<GitHubProfile>protected String getProfileUrl(org.scribe.model.Token accessToken)
BaseOAuthClientgetProfileUrl in class BaseOAuthClient<GitHubProfile>accessToken - only used when constructing dynamic urls from data in the tokenprotected GitHubProfile extractUserProfile(String body)
BaseOAuthClientextractUserProfile in class BaseOAuthClient<GitHubProfile>protected boolean requiresStateParameter()
BaseOAuth20ClientrequiresStateParameter in class BaseOAuth20Client<GitHubProfile>protected boolean hasBeenCancelled(WebContext context)
BaseOAuthClienthasBeenCancelled in class BaseOAuthClient<GitHubProfile>context - the web context.public String getScope()
public void setScope(String scope)
Copyright © 2014. All Rights Reserved.