Stateless session refresh
Feature of refreshing the stateless session is directly connected to stateless registration feature and it is used to prolong the Access Token validity. Access Token validity can be set via backend in app configuration.
SDK automatically will try to refresh the Access Token if user is in stateless session and token is expired. Auto refresh can eventually fail if max registration validity
option in App Configuation is set to fixed time.
SDK offers public api method to manually refresh the token on demand.
public void refreshStatelessSession(@NonNull final OneginiRefreshStatelessSessionHandler handler) {
sdkClient.refreshStatelessSession(handler);
}
To handle callbacks from the SDK, interface implementation needs to be passed as a method parameter.
/**
* Interface to handle refresh of stateless session
*/
interface OneginiRefreshStatelessSessionHandler {
/**
* Method called on successful stateless session refresh
*/
fun onSuccess()
/**
* Method called on stateless session refresh error
*
* @param error instance of [OneginiRefreshStatelessSessionError] with error details
*/
fun onError(error: OneginiRefreshStatelessSessionError)
}