# AuthTabIntent.AuthenticateUserResultContract

Artifact: [androidx.browser:browser](https://developer.android.com/jetpack/androidx/releases/browser) [View Source](https://cs.android.com/search?q=file:androidx/browser/auth/AuthTabIntent.java+class:androidx.browser.auth.AuthTabIntent.AuthenticateUserResultContract) Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/browser#1.10.0)

*** ** * ** ***


```
public class AuthTabIntent.AuthenticateUserResultContract extends ActivityResultContract<Intent, AuthTabIntent.AuthResult>
```

<br />

|---|---|---|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) |||
| ↳ | [androidx.activity.result.contract.ActivityResultContract](https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract)\<[Intent](https://developer.android.com/reference/android/content/Intent.html), [AuthTabIntent.AuthResult](https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.AuthResult)\> ||
|   | ↳ | [androidx.browser.auth.AuthTabIntent.AuthenticateUserResultContract](https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.AuthenticateUserResultContract) |

*** ** * ** ***

An `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract` for launching an Auth Tab and receiving the result. This contract takes the launch `https://developer.android.com/reference/android/content/Intent.html` as input and produces an `https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.AuthResult` as output.

## Summary

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.AuthenticateUserResultContract#AuthenticateUserResultContract()()` |

| ### Public methods |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html` | `https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.AuthenticateUserResultContract#createIntent(android.content.Context,android.content.Intent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context, @https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html input)` Creates the `https://developer.android.com/reference/android/content/Intent.html` to be used to launch the Auth Tab activity. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.AuthResult` | `https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.AuthenticateUserResultContract#parseResult(int,android.content.Intent)(int resultCode, @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Intent.html intent)` Parses the result from the Auth Tab into an `https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.AuthResult`. |

### Inherited methods

From [androidx.activity.result.contract.ActivityResultContract](https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract) `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract.SynchronousResult<O>` `https://developer.android.com/reference/androidx/activity/result/contract/ActivityResultContract#getSynchronousResult(android.content.Context,I)(https://developer.android.com/reference/android/content/Context.html context, I input)`

An optional method you can implement that can be used to potentially provide a result in lieu of starting an activity.

## Public constructors

### AuthenticateUserResultContract

Added in 1.10.0

```
public AuthenticateUserResultContract()
```

## Public methods

### createIntent

Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/browser#1.10.0)

```
public @NonNull Intent createIntent(@NonNull Context context, @NonNull Intent input)
```

Creates the `https://developer.android.com/reference/android/content/Intent.html` to be used to launch the Auth Tab activity.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Context.html context` | The context from which the activity is being launched. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html input` | The `https://developer.android.com/reference/android/content/Intent.html` built by `https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.Builder`. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html` | The same `https://developer.android.com/reference/android/content/Intent.html` that was passed as input, which will be used to start the activity. |

### parseResult

Added in [1.10.0](https://developer.android.com/jetpack/androidx/releases/browser#1.10.0)

```
public @NonNull AuthTabIntent.AuthResult parseResult(int resultCode, @Nullable Intent intent)
```

Parses the result from the Auth Tab into an `https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.AuthResult`.

| Parameters |
|---|---|
| `int resultCode` | The result code returned by the activity. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/content/Intent.html intent` | The `https://developer.android.com/reference/android/content/Intent.html` returned by the activity, which may contain result data. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.AuthResult` | An `https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.AuthResult` representing the outcome of the authentication flow. |