> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Authenticate with an External JWT

> Sign users into Dynamic with a JWT issued by your own authentication provider (Bring Your Own Auth).

<Note>
  Bring Your Own Auth is an enterprise feature. Contact us [in Slack](https://dynamic.xyz/slack) or at [dynamic@fireblocks.com](mailto:dynamic@fireblocks.com) to enable it.
</Note>

If your app already has an authentication system or uses a provider like Auth0, Firebase Auth, or Supabase, you can exchange the JWT that system issues for a Dynamic session. Dynamic verifies the token, creates or matches a user record, and returns its standard session. For concepts, JWT requirements, and console configuration, see [Bring Your Own Auth](/docs/auth/bring-your-own-auth).

## Prerequisites

* Dynamic Kotlin SDK installed and configured (see [Quickstart](/docs/kotlin/quickstart))
* Bring Your Own Auth enabled and configured in the [Dynamic developer console](https://console.dynamic.xyz) (issuer, JWKS URL, and optionally audience and cookie name)
* Your backend issues a JWT with at least `iss`, `sub`, and `exp` claims

## Sign in

Call `signInWithExternalJwt` on `sdk.auth.externalAuth` with the JWT issued by your auth provider.

```kotlin theme={"system"}
viewModelScope.launch {
    try {
        sdk.auth.externalAuth.signInWithExternalJwt(
            SignInWithExternalJwtParams(jwt = jwtToken)
        )
    } catch (e: Exception) {
        println("External JWT sign-in failed: ${e.message}")
    }
}
```

## Related

* [Bring Your Own Auth](/docs/auth/bring-your-own-auth): concepts, configuration, and JWT requirements.
* [Session Management](/docs/kotlin/session-management): manage the session after sign-in.
