sign In
abstract fun signIn(login: String, password: String, host: String? = null, listener: Connection.ISignInListener? = null)
Initiates a sign-in process using the provided login credentials and an optional custom host URL.
Parameters
login
The user's login credentials.
password
The user's password for authentication.
host
Optional custom host URL for authentication. Set to null for default configuration.
listener
Optional ISignInListener to receive callbacks for sign-in events. Set to null if not required.
Samples
import android.net.Uri
import com.ale.infra.rest.authentication.AuthenticationUrl
import com.ale.infra.rest.listeners.RainbowError
import com.ale.infra.rest.listeners.RainbowListener
import com.ale.rainbowsdk.Connection
import com.ale.rainbowsdk.RainbowSdk
import com.ale.security.util.HttpAuthorizationUtil
fun main() {
//sampleStart
if (RainbowSdk().connection().state != Connection.ConnectionState.DISCONNECTED) {
// User is already authenticating or authenticated
return
}
val sandboxHost = "sandbox.openrainbow.com"
// This is a standard connection using a login and password
RainbowSdk().connection().signIn(
login = login,
password = password,
host = sandboxHost,
listener = object : Connection.ISignInListener {
override fun onSignInSucceeded() {
// Your code to navigate from login screen to home screen
}
override fun onSignInFailed(errorCode: Connection.ErrorCode, error: RainbowError<Unit>) {
// Use error code to display a useful message to the user
}
}
)
//sampleEnd
}
Initiates a sign-in process using the provided login credentials.
Parameters
login
The user's login credentials.
password
The user's password for authentication.
listener
Optional ISignInListener to receive callbacks for sign-in events. Set to null if not required.