Username + Password

TerraCore v0

Login your user with username + password

Installation#

implement("vn.teko.android.auth:terra-auth:$version")

Enable username + password login method in Terra Console#

Please contact us we will setup it for you

Usage#

You will need to implement an username + password login form yourself, then pass input data to TerraAuth for logging in

// create the credential
val credential = UsernamePasswordProvider.getLoginCredential(username, password)
// login
TerraAuth.getInstance(terraApp).loginWithCredential(credential) { result: Result<Unit, Throwable> ->
when (result) {
is Result.Success -> // handle successful login
is Result.Failure -> // handle failed login
}
}

After logging in success, you now have the access_token. Please continue to Access Token Usage for usage guide.