|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.force.sdk.oauth.connector.ForceOAuthConnector
public class ForceOAuthConnector
Main actor in the OAuth handshake. The other pieces of the OAuth integration
rely on the ForceOAuthConnector to handle the details of the OAuth flow.
In addition to the usual OAuth 2.0 protocol a UserDataRetrievalService is passed in and used to retrieve
data about the authenticated user after the handshake completes. This service can either be the standard
service or an application specific one. This allows user data to be accessible to the application.
This object is used from a per application singleton. DO NOT store per request values with this class.
| Nested Class Summary | |
|---|---|
static class |
ForceOAuthConnector.OAuthVersion
OAuth spec version. |
| Field Summary | |
|---|---|
static String |
LOGIN_REDIRECT_URL_ATTRIBUTE
The request attribute that the login redirect url will be read from. |
static String |
REDIRECT_AUTH_URI
The url that is used for the authentication code callback. |
| Fields inherited from interface com.force.sdk.connector.ForceConnector |
|---|
PROXY_HOST, PROXY_PORT |
| Constructor Summary | |
|---|---|
ForceOAuthConnector()
Default constructor. |
|
ForceOAuthConnector(UserDataRetrievalService userDataRetrievalService)
Sets OAuth version to 2.0. |
|
| Method Summary | |
|---|---|
void |
close()
Closes the connection. |
String |
getAccessCode(javax.servlet.http.HttpServletRequest request)
Parses the access code in the servlet request. |
SecurityContext |
getAccessToken(String accessCode,
String redirectUri)
Gets the access token for user. |
String |
getForceLogoutUrl(javax.servlet.http.HttpServletRequest request,
String forceEndpoint,
String localLogoutSuccessfulPath)
Builds the logout url. |
String |
getHostPort(javax.servlet.http.HttpServletRequest request)
Returns the host and port of the endpoint. |
String |
getHostPort(String endpoint,
String protocol)
Returns the host and port of the endpoint. |
String |
getLoginRedirectUrl(javax.servlet.http.HttpServletRequest request)
Gets the url that the user will be redirected to for authentication. |
ForceOAuthConnector.OAuthVersion |
getOAuthVersion()
|
String |
getRedirectUri(javax.servlet.http.HttpServletRequest request)
Gets the URI to redirect to for user authentication. |
SecurityContext |
refreshAccessToken(String refreshToken)
Uses the refresh token to obtain a new auth token for the user. |
void |
setConnectionInfo(ForceOAuthConnectionInfo connectionInfo)
|
void |
setConnectionName(String connectionName)
|
void |
setOAuthVersion(String oauthVersion)
|
void |
setTokenRetrievalService(TokenRetrievalService tokenRetrievalService)
|
void |
setUserDataRetrievalService(UserDataRetrievalService userDataRetrievalService)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String REDIRECT_AUTH_URI
public static final String LOGIN_REDIRECT_URL_ATTRIBUTE
| Constructor Detail |
|---|
public ForceOAuthConnector()
public ForceOAuthConnector(UserDataRetrievalService userDataRetrievalService)
UserDataRetrievalService so that
an extension can be used.
userDataRetrievalService - UserDataRetrievalService| Method Detail |
|---|
public SecurityContext getAccessToken(String accessCode,
String redirectUri)
throws IOException
SecurityContext.
accessCode - StringredirectUri - String
IOException - i/o error
public SecurityContext refreshAccessToken(String refreshToken)
throws IOException
refreshToken - String
IOException - i/o errorpublic void close()
public String getAccessCode(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequest
public String getForceLogoutUrl(javax.servlet.http.HttpServletRequest request,
String forceEndpoint,
String localLogoutSuccessfulPath)
request - HttpServletRequestforceEndpoint - StringlocalLogoutSuccessfulPath - String
public String getHostPort(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequest
public String getHostPort(String endpoint,
String protocol)
endpoint - Stringprotocol - String
public String getLoginRedirectUrl(javax.servlet.http.HttpServletRequest request)
throws IOException
request - HttpServletRequest
IOException - i/o errorpublic String getRedirectUri(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequest
public void setConnectionName(String connectionName)
public void setConnectionInfo(ForceOAuthConnectionInfo connectionInfo)
public void setOAuthVersion(String oauthVersion)
public ForceOAuthConnector.OAuthVersion getOAuthVersion()
public void setUserDataRetrievalService(UserDataRetrievalService userDataRetrievalService)
public void setTokenRetrievalService(TokenRetrievalService tokenRetrievalService)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||