Authentication and User Management
Every user on your platform must have a corresponding user ID on the GIZO platform. This association is established using the createUser method provided by the GIZO SDK.
Procedure of Authentication of a User
Use your client ID and client secret to authenticate and manage your company's users with the GIZO SDK.
Gizo.setToken(<clientId>, <clientSecret>);
Go to step 4 if the user has already a user ID on the GIZO platform. Otherwise,
Use the createUser method to generate a new user ID:
CoroutineScope(Dispatchers.IO).launch {
val userId = Gizo.createUser();
if (userId != -1) {
Log.d("tag", userId.toString());
}
}
Store the generated ID in your database, so you can use the next time.
Use the GIZO user ID associated to your user to authenticate your user. This can be done through the setUserId method:
CoroutineScope(Dispatchers.IO).launch {
val status = Gizo.setUserId(<gizoUserId>)
Log.d("tag", status.toString());
}
NOTE: It is recommended to store the GIZO User IDs in you database to correlate your app user IDs to their respective GIZO user IDs
Last updated