Key Authentication

Pinggy offers a mechanism for authenticating visitor connections using key-based authentication.

Key-based authentication involves visitors providing an ‘Authorization’ header with the value Bearer <key> with each request made. Pinggy provides the option to set a collection of keys during tunnel creation.

Start tunnel with key authentication as follows:

Like basic authentication, one can set multiple keys as well.

You can customize the command here:


Invalid CIDR Format
Invalid CIDR Format
Alphanumeric characters only

 

If you run the command with your specified port where your service is running, you will get an output similar to the following:

Key Authentication With HTTP Tunnel

Here, you can see that the tunnel is authenticated with the key samplekey.

Key Authentication With HTTP Tunnel

Allow CORS

By default, adding key authentication will stop all requests without a proper Authorization header. But this also interfares with the preflight requests for CORS. In order to allow the preflight requests without auth token, use the x:passpreflight option.

Just pass the optional x:passpreflight argument at the end of the command the command. In addition, add the -t option right after the ssh command.