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

# Authentication

> Add Bearer, API key or Basic auth with the secret half kept in VS Code secure storage.

Dragonfly supports three auth types. Whichever you choose, the secret half is stored in VS Code secure storage, never written into a collection file on disk.

## Auth types

<CardGroup cols={3}>
  <Card title="Bearer Token" icon="https://mintcdn.com/saurabh-dc2af1a9/2Gj8GymSTIUjWURc/icons/key.svg?fit=max&auto=format&n=2Gj8GymSTIUjWURc&q=85&s=b62bc9f43d67291a01a5a078641eec3e" width="24" height="24" data-path="icons/key.svg">
    Sends an `Authorization: Bearer` header with your token.
  </Card>

  <Card title="API Key" icon="https://mintcdn.com/saurabh-dc2af1a9/2Gj8GymSTIUjWURc/icons/fingerprint.svg?fit=max&auto=format&n=2Gj8GymSTIUjWURc&q=85&s=ddb6e1d8f5e2fa3ebce89a6a6af519ba" width="24" height="24" data-path="icons/fingerprint.svg">
    Sends your key in a header or query parameter.
  </Card>

  <Card title="Basic Auth" icon="https://mintcdn.com/saurabh-dc2af1a9/2Gj8GymSTIUjWURc/icons/user-lock.svg?fit=max&auto=format&n=2Gj8GymSTIUjWURc&q=85&s=594daa50326bff5db8ad6bbfae77d2fa" width="24" height="24" data-path="icons/user-lock.svg">
    Sends a username and password using HTTP Basic authentication.
  </Card>
</CardGroup>

## How secrets are stored

Secrets are handled differently from the rest of a request:

* The non-secret parts of a request live in VS Code storage with the collection
* The secret half, such as a token or password, goes into VS Code secure storage
* Secrets are never written into a collection JSON file

This means you can share or export a collection without leaking live credentials. When you [import a collection](/guides/importing), live credentials are left out on purpose for the same reason.

<Warning>
  Because secrets are kept in VS Code secure storage, they are tied to your machine and are not part of an exported collection. Re-enter them after importing a collection elsewhere.
</Warning>
