> ## Documentation Index
> Fetch the complete documentation index at: https://docs.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.

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](https://docs.dynamic.xyz/docs/auth/bring-your-own-auth.md).

## Prerequisites

* Dynamic Swift SDK installed and configured (see [Quickstart](https://docs.dynamic.xyz/docs/swift/quickstart.md))
* Bring Your Own Auth enabled and configured in the [Dynamic 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.

```swift theme={"system"}
let sdk = DynamicSDK.instance()

do {
    try await sdk.auth.externalAuth.signInWithExternalJwt(
        props: SignInWithExternalJwtParams(jwt: jwtToken)
    )
    print("Signed in with external JWT!")
} catch {
    print("External JWT sign-in failed: \(error)")
}
```

## Related

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


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.