# AuthTabSessionToken

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

*** ** * ** ***


```
public final class AuthTabSessionToken
```

<br />

*** ** * ** ***

Wrapper class that can be used as a unique identifier for a session. Also contains an accessor for the `https://developer.android.com/reference/androidx/browser/auth/AuthTabCallback` for the session if there was any.

## Summary

| ### Public methods |
|---|---|
| `static @https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken` | `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken#createSessionTokenFromIntent(android.content.Intent)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent)` Obtain an `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken` from an intent. |
| `boolean` | `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken#equals(java.lang.Object)(https://developer.android.com/reference/java/lang/Object.html o)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/browser/auth/AuthTabCallback` | `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken#getCallback()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/app/PendingIntent.html` | `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken#getId()()` |
| `boolean` | `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken#hasId()()` |
| `int` | `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken#hashCode()()` |
| `boolean` | `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken#isAssociatedWith(androidx.browser.auth.AuthTabSession)(@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/browser/auth/AuthTabSession session)` |

## Public methods

### createSessionTokenFromIntent

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

```
public static @Nullable AuthTabSessionToken createSessionTokenFromIntent(@NonNull Intent intent)
```

Obtain an `https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken` from an intent. See `https://developer.android.com/reference/androidx/browser/auth/AuthTabIntent.Builder` for ways to generate an intent for Auth Tabs.

| Parameters |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/android/content/Intent.html intent` | The intent to generate the token from. This has to include an extra for `https://developer.android.com/reference/androidx/browser/customtabs/CustomTabsIntent#EXTRA_SESSION()`. |

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/browser/auth/AuthTabSessionToken` | The token that was generated. |

### equals

```
public boolean equals(Object o)
```

### getCallback

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

```
public @Nullable AuthTabCallback getCallback()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/browser/auth/AuthTabCallback` | `https://developer.android.com/reference/androidx/browser/auth/AuthTabCallback` corresponding to this session if there was any non-null callbacks passed by the client. |

### getId

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

```
public @Nullable PendingIntent getId()
```

| Returns |
|---|---|
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/android/app/PendingIntent.html` | The session id corresponding to this session, null if there is none. |

### hasId

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

```
public boolean hasId()
```

| Returns |
|---|---|
| `boolean` | Whether this token is associated with a session id. |

### hashCode

```
public int hashCode()
```

### isAssociatedWith

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

```
public boolean isAssociatedWith(@NonNull AuthTabSession session)
```

| Returns |
|---|---|
| `boolean` | Whether this token is associated with the given session. |