Skip to main content
Bruno supports multiple authentication methods that can be configured at the request, folder, or collection level. Auth settings are managed through the Auth component in the request pane and CollectionSettings/Auth for collection-level configuration.

Authentication Modes

Bruno supports the following authentication types, as defined in RequestPane/Auth/AuthMode:

Basic Auth

Username and password authentication using HTTP Basic Auth.

Bearer Token

Token-based authentication using the Authorization header.

OAuth 2.0

Industry-standard OAuth 2.0 with multiple grant types.

API Key

Custom API key in header, query param, or cookie.

AWS Sig v4

Amazon Web Services signature version 4 authentication.

Digest Auth

More secure alternative to Basic Auth using MD5 hashing.

NTLM Auth

Windows NT LAN Manager authentication.

WSSE Auth

WS-Security authentication for SOAP services.

Setting Authentication Mode

Authentication can be configured at three levels:
Set authentication for a specific request in the Auth tab of the request pane.
1

Open Request Auth Tab

Click on the “Auth” tab in the request pane.
2

Select Auth Mode

Use the AuthMode dropdown to select an authentication type.
3

Configure Details

Fill in the required fields for the selected auth method.

Basic Authentication

The BasicAuth component handles HTTP Basic Authentication:

Configuration

string
required
Username for authentication. Supports variable interpolation: {{username}}
string
required
Password for authentication. Supports variable interpolation: {{password}}

Example in .bru File

Using Script for Basic Auth

From the test suite (bruno-tests/collection/auth/basic/via script/Basic Auth 200.bru):
Use pre-request scripts when you need dynamic Basic Auth credentials or custom encoding logic.

Bearer Token

The BearerAuth component handles Bearer token authentication:

Configuration

string
required
Bearer token value. Supports variable interpolation: {{access_token}}

Example

From the test suite:
bruno-tests/collection/auth/bearer/via auth/Bearer Auth 200.bru
Bearer tokens are automatically added to the Authorization header as Bearer {token}.

OAuth 2.0

The OAuth2 component provides comprehensive OAuth 2.0 support with multiple grant types:

Grant Types

The GrantTypeSelector component supports four grant types:
Resource Owner Password Credentials flow.
string
required
Token endpoint URL
string
required
Resource owner username
string
required
Resource owner password
string
OAuth client ID
string
OAuth client secret
string
Requested scopes (space-separated)

OAuth 2.0 Configuration Options

enum
default:"body"
Where to send client credentials:
  • body: In request body (default)
  • header: In Authorization header
enum
default:"header"
Where to include the access token:
  • header: Authorization header (default)
  • query: Query parameter
string
default:"Bearer"
Prefix for token in Authorization header (e.g., “Bearer”, “Token”)
string
default:"access_token"
Query parameter name when tokenPlacement is “query”

OAuth 2.0 Example

API Key Authentication

The ApiKeyAuth component allows flexible API key placement:

Configuration

string
required
API key parameter name (e.g., “X-API-Key”, “api_key”)
string
required
API key value. Supports variables: {{api_key}}
enum
required
Where to send the API key:
  • header: HTTP header
  • query: Query parameter
  • cookie: Cookie

Examples

AWS Signature v4

The AwsV4Auth component provides AWS authentication:

Configuration

string
required
AWS Access Key ID. Use {{aws_access_key_id}} for security.
string
required
AWS Secret Access Key. Use {{aws_secret_access_key}} for security.
string
Optional session token for temporary credentials.
string
required
AWS service name (e.g., “s3”, “execute-api”, “lambda”).
string
required
AWS region (e.g., “us-east-1”, “eu-west-1”).

Example

Never commit AWS credentials to version control. Always use environment variables or secure secret management.

Digest Authentication

The DigestAuth component provides more secure authentication than Basic Auth:

Configuration

string
required
Username for Digest authentication
string
required
Password for Digest authentication

Example

NTLM Authentication

The NTLMAuth component provides Windows NTLM authentication:

Configuration

string
required
Windows username (may include domain: DOMAIN\username)
string
required
Windows password

Example

WSSE Authentication

The WsseAuth component provides WS-Security authentication:

Configuration

string
required
WSSE username
string
required
WSSE password

Authentication Inheritance

Bruno supports authentication inheritance through the collection hierarchy:
1

Set Collection-Level Auth

Configure authentication in Collection Settings → Auth tab.
2

Use 'Inherit' in Requests

In request Auth tab, select “Inherit” mode to use collection/folder auth.
3

Override When Needed

Individual requests can override inherited auth by selecting a different mode.

Inheritance Example

Collection Structure
The collection-level auth in collection.bru:

Using Variables for Security

Store sensitive credentials in environment variables:
environments/production.json
Add environment files to .gitignore to prevent committing secrets:
.gitignore
Use pre-request scripts to fetch tokens dynamically:

Best Practices

Configure auth at the collection or folder level to avoid duplication and ensure consistency.
Never hardcode credentials. Use {{variables}} that reference environment-specific values.
For OAuth 2.0, use post-response scripts to capture and store new access tokens automatically.
Create separate requests to test 401/403 responses with invalid credentials.
Use the Docs tab to document which OAuth scopes or API key permissions are needed.

Next Steps

Scripts

Learn how to automate auth token refresh with scripts

Collection Settings

Configure collection-level authentication

Environment Variables

Manage auth credentials across environments

Tests

Write tests to validate authentication