Request authentication reference

Uses: Insomnia

Some requests require authentication to ensure that the client requests access data securely. In Insomnia, you can configure different authentication types and parameters when you send a request so that it can authenticate.

The Insomnia UI provides a simplified configuration for request authentication. It pre-populates the parameters when you select an auth type so you only have to fill in the values.

How do I configure authentication in my requests in Insomnia?

Navigate to a request in a collection, click the Auth tab below your request, and select an authentication type from the dropdown menu.

Image of all the available request auth types in Insomnia

How do I share authentication across requests?

Set settings (including authentication) once on a folder or, if you’re using Insomnia 13.5 or later, set them on the API Collection using its Auth tab. Then set each request’s authentication type to Inherit from parent.

Insomnia applies settings first from the API Collection, then from each folder (outermost first), then from the request:

  • Authentication: The closest level that sets authentication wins. To inherit it, set the request’s authentication type to Inherit from parent. A request’s own type, including None, overrides inheritance. Requests that inherit OAuth 2.0 share the token stored on the level that owns the configuration.

  • Headers: Insomnia combines headers from every level. When several levels set the same header, it joins the values with a comma. The exception is single-value headers such as Authorization, Content-Type, and Host, where the closest level wins.

  • Scripts: Pre-request and after-response scripts run in the same order: API Collection, then folders, then request.

Which authentication types are supported?

The following authentication types are supported for request authentication in Insomnia:

How does request authentication work?

Request authentication requires the client to validate their identity in some way before they can access the resources from the server.

The following diagram shows how basic auth works when it’s required as part of request authentication:

sequenceDiagram
    participant Client
    participant Server
    Client->>Server: Requests a protected resource
    Server->>Client: Requests username and password
    alt If correct credentials sent
        Client->>Server: Sends username and password
        Server->>Client: Returns requested resource
    else If wrong credentials sent
        Client->>Server: Sends wrong username and password
        Server->>Client: Returns 401 Unauthorized status code
    end

FAQs

If you encounter errors like:

Error: unable to verify the first certificate

or

Error: Hostname/IP doesn't match certificate's altnames

This likely means you’re using an invalid or self-signed certificate, which is a common issue with local development servers.

To bypass this, go to Settings and disable the Validate SSL Certificates option.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!