---
title: "Username and password | WebhookRelay"
meta:
  "og:description": "How to set up authentication for webhooks. This guide shows you how to use basic username and password or token authentication."
  "og:title": "Username and password"
  description: "How to set up authentication for webhooks. This guide shows you how to use basic username and password or token authentication."
---

![Stripes](https://webhookrelay.com/docs/webhooks/auth/username-password/images/stripes.svg)

Documentation

**Fundamentals**

# **Username and password**

How to set up authentication for webhooks. This guide shows you how to use basic username and password or token authentication.

## [Public endpoint authentication](#public-endpoint-authentication)

To enable username and password authentication on all public endpoints that belong to a bucket, go to the authentication section:

![bucket authentication settings](https://webhookrelay.com/docs/webhooks/auth/username-password/images/docs/webhooks/auth/bucket-authentication.png)

Then, you can either select "basic" or "token" authentication methods.

## [Basic authentication (username and password)](#basic-authentication-username-and-password)

With basic authentication you will need to specify username and password. Unauthenticated requests to bucket's inputs will result in "Unauthorized" error:

```
curl https://hqzxx4bpayrk4sdrfifte6.hooks.webhookrelay.com
Unauthorized
```

The endpoint now expects a request to have 'Authorization: Basic

' header. Tools like curl can help authenticate:

```
curl \
  --user test-username:test-password \
  https://hqzxx4bpayrk4sdrfifte6.hooks.webhookrelay.com
```

## [Bearer (token) authentication](#bearer-token-authentication)

To use bearer token authentication, select 'token' from the authentication menu and set your token value. In this case, to successfully send webhooks, you will need to set 'Authorization: Bearer

' header:

```
curl \ 
  -H 'Authorization: Bearer very-secret' \
  https://hqzxx4bpayrk4sdrfifte6.hooks.webhookrelay.com
```

Did this page help you?