diff --git a/README.md b/README.md index 98d635e..154b8bf 100644 --- a/README.md +++ b/README.md @@ -249,6 +249,56 @@ You can add, update, and remove backend services using the following REST endpoi - PUT /services/{name} - Updates an existing backend service - DELETE /services/{name} - Removes a backend service +## Adding authentication to backend services +Frontman currently supports two methods of authentication: JWT tokens and Basic Auth. Authentication can be configured for each backend service separately using the `auth` configuration +option: + +- Basic Auth with Username and Password In config: +```yaml + # .. backend config + auth: + type: "basic" + basic: + username: "test" + password: "test" +``` + +- Basic Auth with username and password environment variable: +```yaml + # .. backend config + auth: + type: "basic" + basic: + usernameEnvVariable: "API_USERNAME" + passwordEnvVariable: "API_PASSWORD" +``` + +- Basic Auth with username and password stored in credentials file: +```yaml + # .. backend config + auth: + type: "basic" + basic: + credentialsFile: "credentials.yaml" +``` + +credentials.yaml: +```yaml +username: "filetest" +password: "filetest" +``` + +- JWT Auth: +```yaml + # .. backend config + type: "jwt" + userDataContextKey: "user" # Header for storing user claims + jwt: + audience: + issuer: + keysUrl: +``` + ## Frontman Plugins Frontman allows you to create custom plugins that can be used to extend its functionality. Plugins are implemented using the FrontmanPlugin interface, which consists of three methods: @@ -310,4 +360,4 @@ Once you have updated the configuration file, restart Frontman to load the new p If you'd like to contribute to Frontman, please fork the repository and submit a pull request. We welcome bug reports, feature requests, and code contributions. ## License -Frontman is released under the GNU General Public License. See LICENSE for details. \ No newline at end of file +Frontman is released under the GNU General Public License. See LICENSE for details.