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, wait
getName
public void prepare(ContentContext ctx) throws Exception
ISocialNetwork
prepare
in interface ISocialNetwork
org.apache.oltu.oauth2.common.exception.OAuthSystemException
Exception
public String getToken()
getToken
in interface ISocialNetwork
public String getLogin()
getLogin
in interface ISocialNetwork
public String getURL()
getURL
in interface ISocialNetwork
public Map<String,String> getData()
getData
in interface ISocialNetwork
public void setToken(String token)
setToken
in interface ISocialNetwork
public void setURL(String url)
setURL
in interface ISocialNetwork
public void setLogin(String login)
setLogin
in interface ISocialNetwork
public void set(String key, String value)
set
in interface ISocialNetwork
public void update(Map map)
ISocialNetwork
update
in interface ISocialNetwork
public String getClientId()
getClientId
in interface ISocialNetwork
public void setClientId(String clientId)
setClientId
in interface ISocialNetwork
public String getClientSecret()
getClientSecret
in interface ISocialNetwork
public void setClientSecret(String clientSecret)
setClientSecret
in interface ISocialNetwork
public String getApiKey()
getApiKey
in interface ISocialNetwork
public void setApiKey(String clientSecret)
setApiKey
in interface ISocialNetwork
protected String getState(ContentContext ctx) throws Exception
Exception
public abstract String getAuthzEndpoint()
public abstract String getTokenEndpoint()
public String getSigninURL(ContentContext ctx) throws Exception
getSigninURL
in interface ISocialNetwork
Exception
protected 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
Exception
protected 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.OAuthSystemException
public String getRedirectURL()
getRedirectURL
in interface ISocialNetwork
public void setRedirectURL(String redirectURL)
setRedirectURL
in interface ISocialNetwork
public void performRedirect(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
performRedirect
in interface ISocialNetwork
public SocialUser getSocialUser(javax.servlet.http.HttpServletRequest request)
getSocialUser
in interface ISocialNetwork
public 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.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
protected 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.OAuthSystemException
org.apache.oltu.oauth2.common.exception.OAuthProblemException
protected 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.OAuthSystemException
protected SocialUser getSocialUser(String accessToken, org.apache.oltu.oauth2.client.OAuthClient oAuthClient) throws Exception
Exception
protected 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.