Logo

Tutorials

Basic Auth

In this tutorial we will take a look at how you can secure your apps hosted on Sliplane with basic auth.

Basic auth is a simple way to secure your apps by adding a username and password to your app that will be prompted by the browser. To achieve this, we will deploy your app that you want to secure with basic auth as a private service and then we will deploy a basic auth proxy service that will act as a reverse proxy and add basic auth to your app.

If you prefer just seeing the code and figuring out the rest yourself, you can find the complete code for this tutorial on GitHub.

Prerequisites

  • A Sliplane account
  • A private HTTP service that you want to secure with basic auth
  • 10 minutes of your time!

Setup

  1. Fork the basic-auth-proxy repository
  2. Give Sliplane access to your forked repository
  3. Set the healthcheck to /health
  4. Set the following environment variables:
PORT=8080
HTTP_BASIC_AUTH_USER=yourusername
HTTP_BASIC_AUTH_PASSWORD=yourpassword
PRIVATE_WEBSITE_URL=the-url-of-your-private-service, including protocol and port

You can find the private website URL by clicking on the service in the Sliplane dashboard and looking at the URL field. 5. Deploy the service

Screenshot

You can now access your private service by visiting the URL of the service in the Sliplane dashboard!


If you have any questions or need assistance in setting up your basic auth proxy, please do not hesitate to contact us. We're always here to help!

Previous
Getting started