public class GitHubClient extends OAuth20Client<GitHubProfile>
This class is the OAuth client to authenticate users in GitHub.
The scope can be defined to require specific permissions from the user by using the setScope(String)
method. By default,
the scope is: user
.
It returns a GitHubProfile
.
More information at http://developer.github.com/v3/users/
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_SCOPE |
protected String |
scope |
configuration
ATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, urlResolver
logger
Constructor and Description |
---|
GitHubClient() |
GitHubClient(String key,
String secret) |
Modifier and Type | Method and Description |
---|---|
protected void |
clientInit(WebContext context)
Initialize the client.
|
String |
getScope() |
void |
setScope(String scope) |
getConfiguration, getKey, getSecret, setConfiguration, setKey, setSecret, toString
computeFinalCallbackUrl, defaultLogoutActionBuilder, defaultRedirectActionBuilder, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCredentials, getLogoutAction, getLogoutActionBuilder, getRedirectAction, getRedirectActionBuilder, getUrlResolver, internalInit, isIncludeClientNameInCallbackUrl, redirect, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setIncludeClientNameInCallbackUrl, setLogoutActionBuilder, setRedirectActionBuilder, setUrlResolver
addAuthorizationGenerator, addAuthorizationGenerators, defaultAuthenticator, defaultCredentialsExtractor, defaultProfileCreator, getAuthenticator, getAuthorizationGenerators, getCredentialsExtractor, getName, getProfileCreator, getUserProfile, notifySessionRenewal, retrieveCredentials, retrieveUserProfile, setAuthenticator, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setCredentialsExtractor, setName, setProfileCreator
init, reinit
public static final String DEFAULT_SCOPE
protected String scope
protected void clientInit(WebContext context)
IndirectClient
clientInit
in class OAuth20Client<GitHubProfile>
context
- the web contextpublic String getScope()
public void setScope(String scope)
Copyright © 2017. All rights reserved.