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

> [card] Recommended: JavaScript SDK for React Native
>
> While this SDK is still supported, we recommend using newer [JavaScript SDK](https://docs.dynamic.xyz/docs/javascript/reference/react-native-quickstart.md), which is optimized for React Native, but also comes with a host of other benefits.

> [!NOTE]
>
> Bring Your Own Auth (BYOA) 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 you already issue your own JWTs (e.g. from Auth0, Firebase Auth, Supabase, or your own backend), you can exchange that JWT for a Dynamic session. After sign-in, the user behaves like any other Dynamic user — with access to wallets, user management, and the rest of the SDK.

For concepts and configuration, see [Bring Your Own Auth](https://docs.dynamic.xyz/docs/auth/bring-your-own-auth.md).

> [!NOTE]
>
> Issue a Dynamic-specific JWT from your auth provider — separate from your application's normal access token — so the token Dynamic receives cannot be used to access resources on your own servers. See [Bring Your Own Auth](https://docs.dynamic.xyz/docs/auth/bring-your-own-auth.md) for the full recommendation.

## Prerequisites

* [BYOA configured](https://docs.dynamic.xyz/docs/auth/bring-your-own-auth.md) in your Dynamic Console (issuer, JWKS URL).
* Dynamic client created and initialized (see the [React Native quickstart](https://docs.dynamic.xyz/docs/react-native/reference/quickstart.md)).
* Your backend issues a JWT with at least `iss`, `sub`, and `exp` claims.

## Usage

Call `signInWithExternalJwt` on the Dynamic client's external auth. Dynamic verifies the signature against your configured JWKS URL, validates the claims, and establishes a session.

```tsx React Native theme={"system"}
import { dynamicClient } from '<path to client file>';

const signIn = async (externalJwt: string, externalUserId: string) => {
  try {
    await dynamicClient.auth.external.signInWithExternalJwt({
      externalJwt,
      externalUserId,
    });

  } catch (e) {
    console.error('Dynamic sign-in failed:', e);
  }
};
```

## Parameters

| Parameter | Type | Required | Description |
| - | - | - | - |
| `externalJwt` | `string` | Yes | The raw encoded JWT issued by your authentication provider. |
| `externalUserId` | `string` | Yes | The user ID in your authentication system. Must match the `sub` claim in the JWT — Dynamic derives the stored external user ID from the JWT server-side. |

## Related

* [Bring Your Own Auth](https://docs.dynamic.xyz/docs/auth/bring-your-own-auth.md) — Concepts, configuration, and JWT requirements.
* [Dynamic client reference](https://docs.dynamic.xyz/docs/react-native/reference/package-references/client.md) — All methods available on the client.


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