BasicSingleLogin

Basic HTTP authentication using pre-set username and password. Not particularly safe but sort-of useful.

What it does

When the site visitor hits this Service, they will be presented by their browser's username/password window to protect the next page. It implements the commonly used but insecure basic access authentication.

How it works

{

        plugins = [
                f"Auth.dll",
                f"BasicHttpServer.dll",
                f"OutputComposing.dll"];

        instances = {
                server = HttpService(
                        prefixes = ["http://localhost:8080/"]
                ) {
                        http_branch = BasicSingleLogin(
                                username = "alice",
                                password = "bob",
                                realm = "andrew"
                        ) {
                                successful_branch = Template(
                                        f"index.html");
                        };
                };
        };
}

Settings

username this is the username that the visitor will have to enter in order to gain access
password this is the password that the visitor will have to enter in order to gain access
realm browsers typically expect to be able to reuse credentials at logins with similar realms

Branches

successful program flow will proceed into this branch when correct login information to this realm is provided
failure program flow will proceed into this branch when incorrect login information to this realm is provided