# Authentication API URL: https://developers.vsee.com/guides/clinickit/android-authentication-api An interface for adding authentication to your app, so users can log in securely and access protected resources. ### Login ```kotlin /** * Interface for authentication. */ interface Auth { /** * Login as a guest. * * @param firstName The first name of the guest. * @param lastName The last name of the guest. * @param dob The date of birth of the guest. * @return A resource containing the login SSO response. */ suspend fun loginAsGuest(firstName: String, lastName: String, dob: String): Resource /** * Login as a patient. * * @param username The username of the patient. * @param password The password of the patient. * @return A resource containing the login response. */ suspend fun loginAsPatient(username: String, password: String): Resource /** * Login with a token. * * @param token The token for authentication. * @return A resource containing the login response. */ suspend fun loginWithToken(token: String): Resource } ``` ##### Example usage ```kotlin /** * Launches a coroutine to login as guest. */ viewModelScope.launch { val res = VseeApi.auth.loginAsGuest(firstName = firstName, lastName = lastName, dob = dob) when (res) { is Resource.Success -> { // Save user data. } is Resource.Error -> Timber.e("Login error: ${res.message}") } } ```