Package org.webbitserver.handler.authentication

Examples of org.webbitserver.handler.authentication.BasicAuthenticationHandler


    static Executor backgroundAuthenticatorThread = Executors.newSingleThreadExecutor();

    public static void main(String[] args) throws IOException {
        WebServer webServer = createWebServer(45454)
                .add(new BasicAuthenticationHandler(new SlowPasswordAuthenticator()))
                .add("/whoami", new WhoAmIHttpHandler())
                .add("/whoami-ws", new WhoAmIWebSocketHandler())
                .add(new StaticFileHandler("src/test/java/samples/authentication/content"))
                .start();
View Full Code Here


        InMemoryPasswords passwords = new InMemoryPasswords()
                .add("joe", "secret")
                .add("jeff", "somepassword");

        WebServer webServer = createWebServer(45453)
                .add(new BasicAuthenticationHandler(passwords))
                .add("/whoami", new WhoAmIHttpHandler())
                .add("/whoami-ws", new WhoAmIWebSocketHandler())
                .add(new StaticFileHandler("src/test/java/samples/authentication/content"))
                .start();
View Full Code Here

        port = PortProber.findFreePort();
        File htdocs = FileUtils.toFile(getClass().getResource("/htdocs"));
        server = WebServers.createWebServer(port)
            .add("/form_posted\\.html", new FormPosted())
            .add(new StaticFileHandler(htdocs))
            .add("/basic", new BasicAuthenticationHandler(new InMemoryPasswords().add("user", "pass")))
            .add("/redirect", new RedirectHandler("http://" + getServerNameString() + "/index.html"))
            .add("/basic/redirect", new RedirectHandler("http://" + getServerNameString() + "/basic/index.html"));
        try {
            server.start().get();
        } catch (InterruptedException e) {
View Full Code Here

    static Executor backgroundAuthenticatorThread = Executors.newSingleThreadExecutor();

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        WebServer webServer = createWebServer(45454)
                .add(new BasicAuthenticationHandler(new SlowPasswordAuthenticator()))
                .add("/whoami", new WhoAmIHttpHandler())
                .add("/whoami-ws", new WhoAmIWebSocketHandler())
                .add(new StaticFileHandler("src/test/java/samples/authentication/content"))
                .start()
                .get();
View Full Code Here

        InMemoryPasswords passwords = new InMemoryPasswords()
                .add("joe", "secret")
                .add("jeff", "somepassword");

        WebServer webServer = createWebServer(45453)
                .add(new BasicAuthenticationHandler(passwords))
                .add("/whoami", new WhoAmIHttpHandler())
                .add("/whoami-ws", new WhoAmIWebSocketHandler())
                .add(new StaticFileHandler("src/test/java/samples/authentication/content"))
                .start().get();
View Full Code Here

TOP

Related Classes of org.webbitserver.handler.authentication.BasicAuthenticationHandler

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.