# RemoteAuthRequestHandler

Artifact: [androidx.wear:wear-phone-interactions](https://developer.android.com/jetpack/androidx/releases/wear) [View Source](https://cs.android.com/search?q=file:androidx/wear/phone/interactions/authentication/RemoteAuthService.kt+class:androidx.wear.phone.interactions.authentication.RemoteAuthRequestHandler) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#1.0.0)

*** ** * ** ***


```
public interface RemoteAuthRequestHandler
```

<br />

*** ** * ** ***

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

## Summary

| ### Public methods |
|---|---|
| `abstract boolean` | `https://developer.android.com/reference/androidx/wear/phone/interactions/authentication/RemoteAuthRequestHandler#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 |
| `abstract void` | `https://developer.android.com/reference/androidx/wear/phone/interactions/authentication/RemoteAuthRequestHandler#sendAuthRequest(androidx.wear.phone.interactions.authentication.OAuthRequest,kotlin.Pair)( @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/androidx/wear/phone/interactions/authentication/OAuthRequest request, @https://developer.android.com/reference/androidx/annotation/NonNull https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-pair/index.html<@https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/String.html, @https://developer.android.com/reference/androidx/annotation/NonNull https://developer.android.com/reference/java/lang/Integer.html> packageNameAndRequestId )` Handle the auth request by sending it to the phone. |

## Public methods

### isAuthSupported

Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/wear#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](https://developer.android.com/jetpack/androidx/releases/wear#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 `https://developer.android.com/reference/androidx/wear/phone/interactions/authentication/RemoteAuthClient#ERROR_PHONE_UNAVAILABLE()`; otherwise listening for the response from the phone and send it back to the 3p app.

`https://developer.android.com/reference/androidx/wear/phone/interactions/authentication/RemoteAuthService#sendResponseToCallback(androidx.wear.phone.interactions.authentication.OAuthResponse,kotlin.Pair)` is provided for sending response back to the callback provided by the 3p app.