public class FigoConnection extends FigoApi
| Modifier and Type | Field and Description |
|---|---|
protected String |
clientId |
protected String |
clientSecret |
protected String |
redirectUri |
API_FIGO_LIVE, API_FIGO_STAGE| Constructor and Description |
|---|
FigoConnection(String clientId,
String clientSecret,
String redirectUri)
Creates a FigoConnection instance
|
FigoConnection(String clientId,
String clientSecret,
String redirectUri,
int timeout)
Creates a FigoConnection instance
|
FigoConnection(String clientId,
String clientSecret,
String redirectUri,
int timeout,
String apiEndpoint)
Creates a FigoConnection instance
|
| Modifier and Type | Method and Description |
|---|---|
String |
addUser(String name,
String email,
String password,
String language)
Create a new figo Account
|
TokenResponse |
addUserAndLogin(String name,
String email,
String password,
String language)
Creates a new figo User and returns a login token
|
TokenResponse |
convertAuthenticationCode(String authenticationCode)
Convert the authentication code received as result of the login process into an access token usable for data access.
|
TokenResponse |
convertRefreshToken(String refreshToken)
Convert a refresh token (granted for offline access and returned by `convert_authentication_code`) into an access token usable for data access.
|
ProcessToken |
createProcess(BusinessProcess process)
Create a new business process
|
TokenResponse |
credentialLogin(String username,
String password)
Login an user with his figo username and password credentials
|
String |
getLoginUrl(String scope,
String state)
The URL a user should open in his/her web browser to start the login process.
|
void |
revokeToken(String token)
Revoke a granted access or refresh token and thereby invalidate it.
|
void |
startProcess(ProcessToken processToken)
Start a new business process
|
createGson, getApiEndpoint, getTimeout, handleResponse, processResponse, queryApi, setProxy, setTimeout, setTrustManager, setupTrustManagerprotected String clientId
protected String clientSecret
protected String redirectUri
public FigoConnection(String clientId, String clientSecret, String redirectUri)
clientId - the OAuth Client ID as provided by your figo developer contactclientSecret - the OAuth Client Secret as provided by your figo developer contactredirectUri - the URI the users gets redirected to after the login is finished or if he presses cancelspublic FigoConnection(String clientId, String clientSecret, String redirectUri, int timeout)
clientId - the OAuth Client ID as provided by your figo developer contactclientSecret - the OAuth Client Secret as provided by your figo developer contactredirectUri - the URI the users gets redirected to after the login is finished or if he presses cancelstimeout - the timeout used for queriespublic FigoConnection(String clientId, String clientSecret, String redirectUri, int timeout, String apiEndpoint)
clientId - the OAuth Client ID as provided by your figo developer contactclientSecret - the OAuth Client Secret as provided by your figo developer contactredirectUri - the URI the users gets redirected to after the login is finished or if he presses cancelstimeout - the timeout used for queriesapiEndpoint - which endpoint to use (customize for different figo deployment)public String getLoginUrl(String scope, String state)
scope - Scope of data access to ask the user for, e.g. `accounts=ro`state - String passed on through the complete login process and to the redirect target at the end. It should be used to validated the authenticity of
the call to the redirect URLpublic TokenResponse convertAuthenticationCode(String authenticationCode) throws FigoException, IOException
authenticationCode - the code received as part of the call to the redirect URL at the end of the long processFigoExceptionIOExceptionpublic TokenResponse convertRefreshToken(String refreshToken) throws IOException, FigoException
refreshToken - refresh token returned by `convert_authentication_code`FigoException - Base class for all figoExceptionsIOException - IOExceptionpublic TokenResponse credentialLogin(String username, String password) throws IOException, FigoException
username - the user's figo username, this is the `email` from the `CreateUserRequest`password - the user's figo passwordFigoException - Base class for all figoExceptionsIOException - IOExceptionpublic void revokeToken(String token) throws IOException, FigoException
token - access or refresh token to be revokedFigoException - Base class for all figoExceptionsIOException - IOExceptionpublic String addUser(String name, String email, String password, String language) throws IOException, FigoException
name - First and last nameemail - Email address; It must obey the figo username and password policypassword - New figo Account password; It must obey the figo username and password policylanguage - Two-letter code of preferred languageFigoException - Base class for all figoExceptionsIOException - IOExceptionpublic TokenResponse addUserAndLogin(String name, String email, String password, String language) throws IOException, FigoException
name - First and last nameemail - Email address; It must obey the figo username and password policypassword - New figo Account password; It must obey the figo username and password policylanguage - Two-letter code of preferred languageFigoException - Base class for all figoExceptionsIOException - IOExceptionpublic void startProcess(ProcessToken processToken) throws FigoException, IOException
processToken - The unique token that was created by createProcessFigoException - Base class for all figoExceptionsIOException - IOExceptionpublic ProcessToken createProcess(BusinessProcess process) throws FigoException, IOException
process - BusinessProcess object which contains the figo user credentials and the processes to executeFigoException - Base class for all figoExceptionsIOException - IOExceptionCopyright © 2018 figo GmbH. All rights reserved.