Package org.webbitserver.handler.authentication

Examples of org.webbitserver.handler.authentication.InMemoryPasswords


* Passwords are known in advance and stored in memory.
*/
public class SimplePasswordsExample {

    public static void main(String[] args) throws IOException {
        InMemoryPasswords passwords = new InMemoryPasswords()
                .add("joe", "secret")
                .add("jeff", "somepassword");

        WebServer webServer = createWebServer(45453)
                .add(new BasicAuthenticationHandler(passwords))
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

* Passwords are known in advance and stored in memory.
*/
public class SimplePasswordsExample {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        InMemoryPasswords passwords = new InMemoryPasswords()
                .add("joe", "secret")
                .add("jeff", "somepassword");

        WebServer webServer = createWebServer(45453)
                .add(new BasicAuthenticationHandler(passwords))
View Full Code Here

TOP

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

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.