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

  1. Use your client ID and client secret to authenticate and manage your company's users with the GIZO SDK.

Gizo.shared.setToken(clientId: "<clientId>", clientSecret: "<clientSecret>")

Go to step 4 if the user has already a user ID on the GIZO platform. Otherwise,

  1. Use the createUser method to generate a new user ID:

let userId = await Gizo.shared.createUser()
if let userId = userId {
    let status = await Gizo.shared.setUserId(userId: userId)
    print(status)
}
  1. Store the generated ID in your database, so you can use the next time.

  2. Use the GIZO user ID associated to your user to authenticate your user. This can be done through the setUserId method:

let status = await Gizo.shared.setUserId(userId: <gizoUserId>)
print(status)

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