RemoteAuthRequestHandler


public interface RemoteAuthRequestHandler


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

Summary

Public methods

abstract 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

abstract void
sendAuthRequest(
    @NonNull OAuthRequest request,
    @NonNull Pair<@NonNull String, @NonNull Integer> packageNameAndRequestId
)

Handle the auth request by sending it to the phone.

Public methods

isAuthSupported

Added in 1.0.0
abstract boolean isAuthSupported()

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
abstract void sendAuthRequest(
    @NonNull OAuthRequest request,
    @NonNull Pair<@NonNull String, @NonNull Integer> packageNameAndRequestId
)

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.