-
public class Gigya<T extends GigyaAccount>Gigya SDK main interface. Provides access to the Gigya services.
-
-
Method Summary
Modifier and Type Method Description static IoCContainergetContainer()static voidsecureActivityWindow(boolean secure)Use this flag when you want to apply FLAG_SECURE to all SDK activities.These include the screen-set running HostActivity and the WebLoginActivity used forsocial login flows.Default is FALSE. static voidsetErrorReporting(boolean active)Activate SDK error reporting (inactive by default).Reporting is used internally by the SDK to track critical errors within the SDK core flows. static voidsetApplication(Application appContext)static synchronized Gigya<out GigyaAccount>getInstance()static synchronized <V extends GigyaAccount> Gigya<V>getInstance(@NonNull() Class<V> accountClazz)voidinit(@NonNull() String apiKey)Explicitly initialize the SDK.Using this init() method will set the SDK domain to the default "us1.gigya. voidinit(@NonNull() String apiKey, @NonNull() String apiDomain)Explicitly initialize the SDK. voidinit(@NonNull() String apiKey, @NonNull() String apiDomain, @NonNull() String cname)Explicitly initialize the SDK With additional CNAME parameter. Class<T>getAccountSchema()ContextgetContext()voidhandleInterruptions(boolean sdkHandles)Update interruption handling.By default, the Gigya SDK will handle various API interruptions to allow simple resolving of certain common errors.Setting interruptions to FALSE will force the end user to handle his own errors. booleaninterruptionsEnabled()Return SDK interruptions state.if TRUE, interruption handling will be optional via the GigyaLoginCallback. voidsetAccountConfig(GigyaAccountConfig gigyaAccountConfig)Set Account configuration fieldsThese configuration fields will be used by default for all relevant SDK calls. voidsend(String api, Map<String, Object> params, GigyaCallback<GigyaApiResponse> gigyaCallback)Send request to Gigya servers. <V> voidsend(String api, Map<String, Object> params, int requestMethod, Class<V> clazz, GigyaCallback<V> gigyaCallback)Send a generic type request to Gigya servers. SessionInfogetSession()Get current session. voidsetSession(@NonNull() SessionInfo session)Manually set the current session.Setting a session manually will update the current session persistence state and login state. booleanisLoggedIn()Check if we currently have a valid session. voidlogout()Logout of Gigya services.This will clean all session related data persistence. voidlogout(GigyaCallback<GigyaApiResponse> gigyaCallback)Logout of Gigya services.This will clean all session related data persistence. voidsetClearCookies(boolean clear)Enable/Disable clearing cookies from WebView on logout.Default is set to true. voidregisterSessionExpirationObserver(SessionStateObserver observer)voidunregisterSessionExpirationObserver(SessionStateObserver observer)voidregisterSessionVerificationObserver(SessionStateObserver observer)voidunregisterSessionVerificationObserver(SessionStateObserver observer)voidverifySession(GigyaCallback<GigyaApiResponse> gigyaCallback)Validate session endpoint.Please use this over getAccountInfo to check session validation state. voidlogin(String loginId, String password, GigyaLoginCallback<T> gigyaCallback)Login with provided id and password. voidlogin(String loginId, String password, @NonNull() Map<String, Object> params, GigyaLoginCallback<T> gigyaCallback)Login with provided id and password. voidlogin(String loginId, String identifierType, String password, @Nullable() Map<String, Object> params, GigyaLoginCallback<T> gigyaCallback)Login with identifier voidlogin(@NonNull() Map<String, Object> params, GigyaLoginCallback<T> gigyaLoginCallback)Login with given parameters. voidlogin(String socialProvider, Map<String, Object> params, GigyaLoginCallback<T> gigyaLoginCallback)Login given a specific 3rd party provider. voidsso(Map<String, Object> params, GigyaLoginCallback<T> gigyaLoginCallback)Single sign on login. voidgetAccount(@NonNull() GigyaCallback<T> gigyaCallback)Request account info. voidgetAccount(boolean invalidateCache, GigyaCallback<T> gigyaCallback)Request account info. voidgetAccount(@NonNull() Map<String, Object> params, @NonNull() GigyaCallback<T> gigyaCallback)Request account info given parameters map. voidgetAccount(boolean invalidateCache, @NonNull() Map<String, Object> params, @NonNull() GigyaCallback<T> gigyaCallback)Request account info given parameters map. voidgetAccount(@NonNull() Array<String> include, @NonNull() Array<String> profileExtraFields, @NonNull() GigyaCallback<T> gigyaCallback)Request account info given comma separated array of include parameters and comma separated array of profile extra fields. voidsetAccount(T account, GigyaCallback<T> gigyaCallback)Set account info voidsetAccount(Map<String, Object> params, GigyaCallback<T> gigyaCallback)Set account info given update parameters. voidverifyLogin(String UID, GigyaCallback<T> gigyaCallback)Request verify login given account UID/ voidverifyLogin(String UID, Map<String, Object> params, GigyaCallback<T> gigyaCallback)Request verify login given account UID/ voidregister(String email, String password, @NonNull() Map<String, Object> params, GigyaLoginCallback<T> callback)Register account using email and password combination.Additional parameters are included to allow additional parameters to be added such as profile. voidregister(String email, String password, GigyaLoginCallback<T> callback)Register account using email and password combination. voidforgotPassword(String loginId, GigyaCallback<GigyaApiResponse> gigyaCallback)Send a reset email password to verified email attached to the users loginId. voidforgotPassword(@NonNull() Map<String, Object> params, GigyaCallback<GigyaApiResponse> gigyaCallback)Send a reset email password to verified email attached to the users loginId. voidaddConnection(String socialProvider, GigyaLoginCallback<T> loginCallback)Add a social connection to existing account. voidaddConnection(String socialProvider, @NonNull() Map<String, Object> params, GigyaLoginCallback<T> loginCallback)Add a social connection to existing account. voidremoveConnection(String socialProvider, GigyaCallback<GigyaApiResponse> gigyaCallback)Remove a social connection from an existing account. voidremoveConnection(@NonNull() Map<String, Object> params, GigyaCallback<GigyaApiResponse> gigyaCallback)Remove a social connection from an existing account.Method expects "provider" parameter to be present in the params map. voidnotifySocialLogin(@NonNull() Map<String, Object> params, GigyaLoginCallback<T> gigyaLoginCallback)Login to with social provider when the provider session is available (obtained via specific provider login process). voidsetExternalProvidersPath(String path)Custom setter for external provider package path. ProvidergetUsedSocialProvider(String name)Request reference to used Gigya social provider.Currently supported provider (GOOGLE, FACEBOOK, LINE, WECHAT). ProviderWrappergetUsedSocialProviderWrapper(String name)Request reference to used Social native provide wrapper class.Currently supported provider (GOOGLE, FACEBOOK, LINE, WECHAT). voidsocialLoginWith(List<String> providers, @NonNull() Map<String, Object> params, GigyaLoginCallback<T> gigyaLoginCallback)Present social login selection list. voidshowScreenSet(String screensSet, boolean fullScreen, @NonNull() Map<String, Object> params, GigyaPluginCallback<T> gigyaPluginCallback)Show Gigya ScreenSets flow using the PluginFragment.UI will be presented via WebView. voidshowScreenSet(String screensSet, boolean obfuscate, boolean fullScreen, @NonNull() Map<String, Object> params, GigyaPluginCallback<T> gigyaPluginCallback)Show Gigya ScreenSets flow using the PluginFragment.UI will be presented via WebView. voidupdateDeviceInfo(@NonNull() String newPushToken)Update device information in server.Device information includes: platform, manufacturer, os and push token.Use this method manually if your flow requires to update the push service token.Additional device info is generated at runtime. IGigyaWebBridge<T>createWebBridge()Create an new instance of the GigyaWebBridge. IWebAuthnServiceWebAuthn()voidsetPasskeyAuthenticatorProvider(IPasskeysAuthenticationProvider provider)voidgetAuthCode(GigyaCallback<String> gigyaCallback)voidgetSaptchaToken(GigyaCallback<GigyaApiResponse> gigyaCallback)voidisAvailableLoginId(@NonNull() String loginId, @NonNull() GigyaCallback<Boolean> gigyaCallback)This method checks whether a certain login identifier (username / email) is available.A login identifier is available if it is unique in this user management system. voidgetSchema(@NonNull() GigyaCallback<GigyaSchema> gigyaCallback)This method retrieves the schema of the Profile object and the Data object(the site specific custom data object) in Gigya's Accounts Storage. voidgetSchema(@NonNull() Map<String, Object> params, @NonNull() GigyaCallback<GigyaSchema> gigyaCallback)This method retrieves the schema of the Profile object and the Data object(the site specific custom data object) in Gigya's Accounts Storage. voidsetDefaultHttpProvider()*Manually force the SDK to use default http provider (ignores okHttp). voidsetWebViewConfig(WebViewConfig webViewConfig)External setter to allow local storage in all SDK WebView usage.Default is set to true if not specified. -
-
Method Detail
-
getContainer
static IoCContainer getContainer()
-
secureActivityWindow
static void secureActivityWindow(boolean secure)
Use this flag when you want to apply FLAG_SECURE to all SDK activities.These include the screen-set running HostActivity and the WebLoginActivity used forsocial login flows.Default is FALSE.
-
setErrorReporting
static void setErrorReporting(boolean active)
Activate SDK error reporting (inactive by default).Reporting is used internally by the SDK to track critical errors within the SDK core flows.
- Parameters:
active- True to activate.
-
setApplication
static void setApplication(Application appContext)
-
getInstance
static synchronized Gigya<out GigyaAccount> getInstance()
-
getInstance
static synchronized <V extends GigyaAccount> Gigya<V> getInstance(@NonNull() Class<V> accountClazz)
-
init
void init(@NonNull() String apiKey)
Explicitly initialize the SDK.Using this init() method will set the SDK domain to the default "us1.gigya.com"see init to explicitly set the required domain.
- Parameters:
apiKey- Client API-KEY.
-
init
void init(@NonNull() String apiKey, @NonNull() String apiDomain)
Explicitly initialize the SDK.
- Parameters:
apiKey- Client API-KEYapiDomain- Request Domain.
-
init
void init(@NonNull() String apiKey, @NonNull() String apiDomain, @NonNull() String cname)
Explicitly initialize the SDK With additional CNAME parameter.
- Parameters:
apiKey- Client API-KEYapiDomain- Request Domain.cname- CNAME.
-
getAccountSchema
Class<T> getAccountSchema()
-
getContext
Context getContext()
-
handleInterruptions
void handleInterruptions(boolean sdkHandles)
Update interruption handling.By default, the Gigya SDK will handle various API interruptions to allow simple resolving of certain common errors.Setting interruptions to FALSE will force the end user to handle his own errors.
- Parameters:
sdkHandles- False if manually handling all errors.
-
interruptionsEnabled
boolean interruptionsEnabled()
Return SDK interruptions state.if TRUE, interruption handling will be optional via the GigyaLoginCallback.
-
setAccountConfig
void setAccountConfig(GigyaAccountConfig gigyaAccountConfig)
Set Account configuration fields
These configuration fields will be used by default for all relevant SDK calls.
- Parameters:
gigyaAccountConfig- AccountConfig object.
-
send
void send(String api, Map<String, Object> params, GigyaCallback<GigyaApiResponse> gigyaCallback)
Send request to Gigya servers.
- Parameters:
api- Request method identifier.params- Additional parameters.gigyaCallback- Response listener callback.
-
send
<V> void send(String api, Map<String, Object> params, int requestMethod, Class<V> clazz, GigyaCallback<V> gigyaCallback)
Send a generic type request to Gigya servers.
- Parameters:
api- Request method identifier.params- Additional parameters.requestMethod- Request method (GET, POST).clazz- Response class scheme.gigyaCallback- Response listener callback.
-
getSession
@Nullable() SessionInfo getSession()
Get current session.
-
setSession
void setSession(@NonNull() SessionInfo session)
Manually set the current session.Setting a session manually will update the current session persistence state and login state.
- Parameters:
session- SessionInfo instance.
-
isLoggedIn
boolean isLoggedIn()
Check if we currently have a valid session.
-
logout
void logout()
Logout of Gigya services.This will clean all session related data persistence.
-
logout
void logout(GigyaCallback<GigyaApiResponse> gigyaCallback)
Logout of Gigya services.This will clean all session related data persistence.
- Parameters:
gigyaCallback- Response listener callback.
-
setClearCookies
void setClearCookies(boolean clear)
Enable/Disable clearing cookies from WebView on logout.Default is set to true.
- Parameters:
clear- False to disable clearing cookies from WebView instances on logout.
-
registerSessionExpirationObserver
void registerSessionExpirationObserver(SessionStateObserver observer)
-
unregisterSessionExpirationObserver
void unregisterSessionExpirationObserver(SessionStateObserver observer)
-
registerSessionVerificationObserver
void registerSessionVerificationObserver(SessionStateObserver observer)
-
unregisterSessionVerificationObserver
void unregisterSessionVerificationObserver(SessionStateObserver observer)
-
verifySession
void verifySession(GigyaCallback<GigyaApiResponse> gigyaCallback)
Validate session endpoint.Please use this over getAccountInfo to check session validation state.
- Parameters:
gigyaCallback- Response listener callback.
-
login
void login(String loginId, String password, GigyaLoginCallback<T> gigyaCallback)
Login with provided id and password.
- Parameters:
loginId- LoginID.password- Login password.gigyaCallback- Response listener callback.
-
login
void login(String loginId, String password, @NonNull() Map<String, Object> params, GigyaLoginCallback<T> gigyaCallback)
Login with provided id and password.
- Parameters:
loginId- LoginID.password- Login password.params- additional parameter map.gigyaCallback- Response listener callback.
-
login
void login(String loginId, String identifierType, String password, @Nullable() Map<String, Object> params, GigyaLoginCallback<T> gigyaCallback)
Login with identifier
- Parameters:
loginId- identifieridentifierType- identifier type.password- passwordparams- additional parameter map.gigyaCallback- Response listener callback.
-
login
void login(@NonNull() Map<String, Object> params, GigyaLoginCallback<T> gigyaLoginCallback)
Login with given parameters.
- Parameters:
params- parameters map.gigyaLoginCallback- Login response callback.
-
login
void login(String socialProvider, Map<String, Object> params, GigyaLoginCallback<T> gigyaLoginCallback)
Login given a specific 3rd party provider.
- Parameters:
socialProvider- Selected providers GigyaDefinitions.Providers.SocialProvider.params- Parameters map.gigyaLoginCallback- Login response callback.
-
sso
void sso(Map<String, Object> params, GigyaLoginCallback<T> gigyaLoginCallback)
Single sign on login.
- Parameters:
params- Additional parameters map.gigyaLoginCallback- Login response callback.
-
getAccount
void getAccount(@NonNull() GigyaCallback<T> gigyaCallback)
Request account info.
- Parameters:
gigyaCallback- Response listener callback.
-
getAccount
void getAccount(boolean invalidateCache, GigyaCallback<T> gigyaCallback)
Request account info.
- Parameters:
invalidateCache- Should override the account caching option.gigyaCallback- Response listener callback.
-
getAccount
void getAccount(@NonNull() Map<String, Object> params, @NonNull() GigyaCallback<T> gigyaCallback)
Request account info given parameters map.
- Parameters:
params- Request parameter map.gigyaCallback- Response listener callback.
-
getAccount
void getAccount(boolean invalidateCache, @NonNull() Map<String, Object> params, @NonNull() GigyaCallback<T> gigyaCallback)
Request account info given parameters map.
- Parameters:
invalidateCache- Should override the account caching option.params- Request parameter map.gigyaCallback- Response listener callback.
-
getAccount
@Deprecated() void getAccount(@NonNull() Array<String> include, @NonNull() Array<String> profileExtraFields, @NonNull() GigyaCallback<T> gigyaCallback)
Request account info given comma separated array of include parameters and comma separated array of profile extra fields.
- Parameters:
include- String[] array.profileExtraFields- String[] array.gigyaCallback- Response listener callback.
-
setAccount
void setAccount(T account, GigyaCallback<T> gigyaCallback)
Set account info
- Parameters:
account- Updated account object.gigyaCallback- Response listener callback.
-
setAccount
void setAccount(Map<String, Object> params, GigyaCallback<T> gigyaCallback)
Set account info given update parameters.
- Parameters:
params- Updated account parameters.gigyaCallback- Response listener callback.
-
verifyLogin
void verifyLogin(String UID, GigyaCallback<T> gigyaCallback)
Request verify login given account UID/
- Parameters:
UID- Account UID identifier.gigyaCallback- Response listener callback.
-
verifyLogin
void verifyLogin(String UID, Map<String, Object> params, GigyaCallback<T> gigyaCallback)
Request verify login given account UID/
- Parameters:
UID- Account UID identifier.params- Additional parameters.gigyaCallback- Response listener callback.
-
register
void register(String email, String password, @NonNull() Map<String, Object> params, GigyaLoginCallback<T> callback)
Register account using email and password combination.Additional parameters are included to allow additional parameters to be added such as profile.
- Parameters:
email- User email identifier.password- User password.params- Additional parameters.callback- Response listener callback.
-
register
void register(String email, String password, GigyaLoginCallback<T> callback)
Register account using email and password combination.
- Parameters:
email- User email identifier.password- User password.callback- Response listener callback.
-
forgotPassword
void forgotPassword(String loginId, GigyaCallback<GigyaApiResponse> gigyaCallback)
Send a reset email password to verified email attached to the users loginId.
- Parameters:
loginId- User login id.gigyaCallback- Response listener callback.
-
forgotPassword
void forgotPassword(@NonNull() Map<String, Object> params, GigyaCallback<GigyaApiResponse> gigyaCallback)
Send a reset email password to verified email attached to the users loginId.
- Parameters:
params- Parameter map.gigyaCallback- Response listener callback.
-
addConnection
void addConnection(String socialProvider, GigyaLoginCallback<T> loginCallback)
Add a social connection to existing account.
- Parameters:
socialProvider- Social provider identifier.loginCallback- Response listener callback.
-
addConnection
void addConnection(String socialProvider, @NonNull() Map<String, Object> params, GigyaLoginCallback<T> loginCallback)
Add a social connection to existing account.
- Parameters:
socialProvider- Social provider identifier.loginCallback- Response listener callback.
-
removeConnection
void removeConnection(String socialProvider, GigyaCallback<GigyaApiResponse> gigyaCallback)
Remove a social connection from an existing account.
- Parameters:
socialProvider- Social provider identifier.gigyaCallback- Response listener callback.
-
removeConnection
void removeConnection(@NonNull() Map<String, Object> params, GigyaCallback<GigyaApiResponse> gigyaCallback)
Remove a social connection from an existing account.Method expects "provider" parameter to be present in the params map.
- Parameters:
params- Parameter map.gigyaCallback- Response listener callback.
-
notifySocialLogin
void notifySocialLogin(@NonNull() Map<String, Object> params, GigyaLoginCallback<T> gigyaLoginCallback)
Login to with social provider when the provider session is available (obtained via specific provider login process).
- Parameters:
params- Parameter map.gigyaLoginCallback- Response listener callback.
-
setExternalProvidersPath
void setExternalProvidersPath(String path)
Custom setter for external provider package path.
- Parameters:
path- Path to package where the external providers path are located.
-
getUsedSocialProvider
@Deprecated()@Nullable() Provider getUsedSocialProvider(String name)
Request reference to used Gigya social provider.Currently supported provider (GOOGLE, FACEBOOK, LINE, WECHAT).
Do not use.Method can produce null pointer exception.
- Parameters:
name- Provider name.
-
getUsedSocialProviderWrapper
@Nullable() ProviderWrapper getUsedSocialProviderWrapper(String name)
Request reference to used Social native provide wrapper class.Currently supported provider (GOOGLE, FACEBOOK, LINE, WECHAT).
- Parameters:
name- Provider name.
-
socialLoginWith
@Deprecated() void socialLoginWith(List<String> providers, @NonNull() Map<String, Object> params, GigyaLoginCallback<T> gigyaLoginCallback)
Present social login selection list.
- Parameters:
providers- List of selected social providers GigyaDefinitions.Providers.SocialProvider.params- Request parameters.gigyaLoginCallback- Login response callback.
-
showScreenSet
void showScreenSet(String screensSet, boolean fullScreen, @NonNull() Map<String, Object> params, GigyaPluginCallback<T> gigyaPluginCallback)
Show Gigya ScreenSets flow using the PluginFragment.UI will be presented via WebView.
- Parameters:
screensSet- Main ScreensSet group identifierfullScreen- Show in fullscreen mode.params- ScreensSet flow parameters.gigyaPluginCallback- Plugin callback.
-
showScreenSet
void showScreenSet(String screensSet, boolean obfuscate, boolean fullScreen, @NonNull() Map<String, Object> params, GigyaPluginCallback<T> gigyaPluginCallback)
Show Gigya ScreenSets flow using the PluginFragment.UI will be presented via WebView.
- Parameters:
screensSet- Main ScreensSet group identifierobfuscate- Obfuscate WebBridge data.fullScreen- Show in fullscreen mode.params- ScreensSet flow parameters.gigyaPluginCallback- Plugin callback.
-
updateDeviceInfo
void updateDeviceInfo(@NonNull() String newPushToken)
Update device information in server.Device information includes: platform, manufacturer, os and push token.Use this method manually if your flow requires to update the push service token.Additional device info is generated at runtime.
- Parameters:
newPushToken- New provided push token.
-
createWebBridge
IGigyaWebBridge<T> createWebBridge()
Create an new instance of the GigyaWebBridge.
-
WebAuthn
IWebAuthnService WebAuthn()
-
setPasskeyAuthenticatorProvider
void setPasskeyAuthenticatorProvider(IPasskeysAuthenticationProvider provider)
-
getAuthCode
void getAuthCode(GigyaCallback<String> gigyaCallback)
-
getSaptchaToken
void getSaptchaToken(GigyaCallback<GigyaApiResponse> gigyaCallback)
-
isAvailableLoginId
void isAvailableLoginId(@NonNull() String loginId, @NonNull() GigyaCallback<Boolean> gigyaCallback)
This method checks whether a certain login identifier (username / email) is available.A login identifier is available if it is unique in this user management system.
- Parameters:
loginId- The login identifier to check if available.gigyaCallback- Response listener callback.
-
getSchema
void getSchema(@NonNull() GigyaCallback<GigyaSchema> gigyaCallback)
This method retrieves the schema of the Profile object and the Data object(the site specific custom data object) in Gigya's Accounts Storage.
- Parameters:
gigyaCallback- Response listener callback.
-
getSchema
void getSchema(@NonNull() Map<String, Object> params, @NonNull() GigyaCallback<GigyaSchema> gigyaCallback)
This method retrieves the schema of the Profile object and the Data object(the site specific custom data object) in Gigya's Accounts Storage.
- Parameters:
params- Additional parameters.gigyaCallback- Response listener callback.
-
setDefaultHttpProvider
void setDefaultHttpProvider()
*Manually force the SDK to use default http provider (ignores okHttp).
-
setWebViewConfig
void setWebViewConfig(WebViewConfig webViewConfig)
External setter to allow local storage in all SDK WebView usage.Default is set to true if not specified.
-
-
-
-