# 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)

*** ** * ** ***


```
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/kotlin/androidx/browser/auth/AuthTabCallback` for the session if there was any.

## Summary

| ### Public functions |
|---|---|
| `java-static https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabSessionToken?` | `https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabSessionToken#createSessionTokenFromIntent(android.content.Intent)(intent: https://developer.android.com/reference/android/content/Intent.html)` Obtain an `https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabSessionToken` from an intent. |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabSessionToken#equals(java.lang.Object)(o: https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html!)` |
| `https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabCallback?` | `https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabSessionToken#getCallback()()` |
| `https://developer.android.com/reference/android/app/PendingIntent.html?` | `https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabSessionToken#getId()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabSessionToken#hasId()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabSessionToken#hashCode()()` |
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | `https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabSessionToken#isAssociatedWith(androidx.browser.auth.AuthTabSession)(session: https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabSession)` |

## Public functions

### createSessionTokenFromIntent

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

```
java-static fun createSessionTokenFromIntent(intent: Intent): AuthTabSessionToken?
```

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

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

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabSessionToken?` | The token that was generated. |

### equals

```
fun equals(o: Any!): Boolean
```

### getCallback

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

```
fun getCallback(): AuthTabCallback?
```

| Returns |
|---|---|
| `https://developer.android.com/reference/kotlin/androidx/browser/auth/AuthTabCallback?` | `https://developer.android.com/reference/kotlin/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)

```
fun getId(): PendingIntent?
```

| Returns |
|---|---|
| `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)

```
fun hasId(): Boolean
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether this token is associated with a session id. |

### hashCode

```
fun hashCode(): Int
```

### isAssociatedWith

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

```
fun isAssociatedWith(session: AuthTabSession): Boolean
```

| Returns |
|---|---|
| `https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html` | Whether this token is associated with the given session. |