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
- Fork the basic-auth-proxy repository
- Give Sliplane access to your forked repository
- Set the healthcheck to /health
- Set the following environment variables:
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
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!