public abstract class AbstractSocialNetwork extends Object implements ISocialNetwork
| Constructor and Description |
|---|
AbstractSocialNetwork() |
| Modifier and Type | Method and Description |
|---|---|
protected org.apache.oltu.oauth2.client.request.OAuthClientRequest |
buildAuthenticationRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder builder) |
protected org.apache.oltu.oauth2.client.request.OAuthClientRequest |
buildTokenRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder builder) |
protected void |
configureAuthenticationRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder builder,
String clientId,
ContentContext ctx) |
protected void |
configureTokenRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder builder,
String clientId,
String clientSecret,
String code) |
protected org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder |
createAuthenticationRequest() |
protected org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder |
createTokenRequest() |
protected org.apache.oltu.oauth2.client.response.OAuthAccessTokenResponse |
executeTokenRequest(org.apache.oltu.oauth2.client.OAuthClient oAuthClient,
org.apache.oltu.oauth2.client.request.OAuthClientRequest request) |
protected void |
fillUserInfo(UserInfo userInfo,
SocialUser socialUser) |
String |
getAccessToken(String code,
org.apache.oltu.oauth2.client.OAuthClient oAuthClient) |
String |
getApiKey() |
abstract String |
getAuthzEndpoint() |
String |
getClientId() |
String |
getClientSecret() |
Map<String,String> |
getData() |
String |
getLogin() |
String |
getLoginURL() |
String |
getRedirectURL() |
String |
getSigninURL(ContentContext ctx) |
SocialUser |
getSocialUser(javax.servlet.http.HttpServletRequest request) |
protected SocialUser |
getSocialUser(String accessToken,
org.apache.oltu.oauth2.client.OAuthClient oAuthClient) |
protected String |
getState(ContentContext ctx) |
String |
getToken() |
abstract String |
getTokenEndpoint() |
String |
getURL() |
protected void |
login(ContentContext ctx,
SocialUser socialUser) |
void |
performRedirect(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
void |
prepare(ContentContext ctx)
prepare social network for rendering
|
void |
set(String key,
String value) |
void |
setApiKey(String clientSecret) |
void |
setClientId(String clientId) |
void |
setClientSecret(String clientSecret) |
void |
setLogin(String login) |
void |
setRedirectURL(String redirectURL) |
void |
setToken(String token) |
void |
setURL(String url) |
void |
update(Map map)
update value with a map.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetNamepublic void prepare(ContentContext ctx) throws Exception
ISocialNetworkprepare in interface ISocialNetworkorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionExceptionpublic String getToken()
getToken in interface ISocialNetworkpublic String getLogin()
getLogin in interface ISocialNetworkpublic String getURL()
getURL in interface ISocialNetworkpublic Map<String,String> getData()
getData in interface ISocialNetworkpublic void setToken(String token)
setToken in interface ISocialNetworkpublic void setURL(String url)
setURL in interface ISocialNetworkpublic void setLogin(String login)
setLogin in interface ISocialNetworkpublic void set(String key, String value)
set in interface ISocialNetworkpublic void update(Map map)
ISocialNetworkupdate in interface ISocialNetworkpublic String getClientId()
getClientId in interface ISocialNetworkpublic void setClientId(String clientId)
setClientId in interface ISocialNetworkpublic String getClientSecret()
getClientSecret in interface ISocialNetworkpublic void setClientSecret(String clientSecret)
setClientSecret in interface ISocialNetworkpublic String getApiKey()
getApiKey in interface ISocialNetworkpublic void setApiKey(String clientSecret)
setApiKey in interface ISocialNetworkprotected String getState(ContentContext ctx) throws Exception
Exceptionpublic abstract String getAuthzEndpoint()
public abstract String getTokenEndpoint()
public String getSigninURL(ContentContext ctx) throws Exception
getSigninURL in interface ISocialNetworkExceptionprotected org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder createAuthenticationRequest()
protected void configureAuthenticationRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder builder,
String clientId,
ContentContext ctx)
throws Exception
Exceptionprotected org.apache.oltu.oauth2.client.request.OAuthClientRequest buildAuthenticationRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest.AuthenticationRequestBuilder builder)
throws org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionpublic String getRedirectURL()
getRedirectURL in interface ISocialNetworkpublic void setRedirectURL(String redirectURL)
setRedirectURL in interface ISocialNetworkpublic void performRedirect(javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
performRedirect in interface ISocialNetworkpublic SocialUser getSocialUser(javax.servlet.http.HttpServletRequest request)
getSocialUser in interface ISocialNetworkpublic String getAccessToken(String code, org.apache.oltu.oauth2.client.OAuthClient oAuthClient) throws org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException
org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionprotected org.apache.oltu.oauth2.client.response.OAuthAccessTokenResponse executeTokenRequest(org.apache.oltu.oauth2.client.OAuthClient oAuthClient,
org.apache.oltu.oauth2.client.request.OAuthClientRequest request)
throws org.apache.oltu.oauth2.common.exception.OAuthSystemException,
org.apache.oltu.oauth2.common.exception.OAuthProblemException
org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionprotected org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder createTokenRequest()
protected void configureTokenRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder builder,
String clientId,
String clientSecret,
String code)
protected org.apache.oltu.oauth2.client.request.OAuthClientRequest buildTokenRequest(org.apache.oltu.oauth2.client.request.OAuthClientRequest.TokenRequestBuilder builder)
throws org.apache.oltu.oauth2.common.exception.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthSystemExceptionprotected SocialUser getSocialUser(String accessToken, org.apache.oltu.oauth2.client.OAuthClient oAuthClient) throws Exception
Exceptionprotected void login(ContentContext ctx, SocialUser socialUser) throws UserAllreadyExistException, IOException
protected void fillUserInfo(UserInfo userInfo, SocialUser socialUser)
public String getLoginURL()
Copyright © 2012-2018. All Rights Reserved.