RemoteAuthRequestHandler

interface RemoteAuthRequestHandler


Interface for specifying how the service handles the remote auth requests.

Summary

Public functions

Boolean

Whether the auth service is enabled, return false would give an early out by sending the 3p app a response with error code of ERROR_UNSUPPORTED

Unit
sendAuthRequest(
    request: OAuthRequest,
    packageNameAndRequestId: Pair<StringInt>
)

Handle the auth request by sending it to the phone.

Public functions

isAuthSupported

Added in 1.0.0
fun isAuthSupported(): Boolean

Whether the auth service is enabled, return false would give an early out by sending the 3p app a response with error code of ERROR_UNSUPPORTED

sendAuthRequest

Added in 1.0.0
fun sendAuthRequest(
    request: OAuthRequest,
    packageNameAndRequestId: Pair<StringInt>
): Unit

Handle the auth request by sending it to the phone. Typically, if the paired phone is not connected, send a response with error code of RemoteAuthClient.ERROR_PHONE_UNAVAILABLE; otherwise listening for the response from the phone and send it back to the 3p app.

RemoteAuthService.sendResponseToCallback is provided for sending response back to the callback provided by the 3p app.