@@ -0,0 +1,1574 @@
+package io.webfolder.cdp.sample;%0A%0Aimport static java.util.Base64.getEncoder;%0A%0Aimport java.util.Collections;%0Aimport java.util.Map;%0A%0Aimport com.google.gson.Gson;%0A%0Aimport io.webfolder.cdp.Launcher;%0Aimport io.webfolder.cdp.command.Network;%0Aimport io.webfolder.cdp.session.Session;%0Aimport io.webfolder.cdp.session.SessionFactory;%0Aimport static java.util.Arrays.asList;%0A%0Apublic class BasicAuthentication %7B%0A%0A    @SuppressWarnings(%22unchecked%22)%0A    public static void main(String%5B%5D args) %7B%0A%0A        Launcher launcher = new Launcher();%0A%0A        try (SessionFactory factory = launcher.launch(asList(%22--headless%22, %22--disable-gpu%22));%0A                            Session session = factory.create()) %7B%0A%0A            Network network = session.getCommand().getNetwork();%0A            network.enable();%0A%0A            Map%3CString, Object%3E headers = Collections.%3CString, Object%3EsingletonMap(%22Authorization%22,%0A                                            %22Basic %22 + new String(getEncoder().encode(%22user:password%22.getBytes())));%0A%0A            network.setExtraHTTPHeaders(headers);%0A%0A            session.navigate(%22https://httpbin.org/basic-auth/user/password%22);%0A            session.wait(1000);%0A%0A            String content = (String) session.evaluate(%22window.document.body.textContent%22);%0A            Map%3CString, Object%3E map = new Gson().fromJson(content, Map.class);%0A            Object authenticated = map.get(%22authenticated%22);%0A            Object user = map.get(%22user%22);%0A%0A            System.out.println(%22Authenticated: %22 + authenticated);%0A            System.out.println(%22User:%22 + user);%0A        %7D%0A%0A    %7D%0A%7D%0A

Add basic authentication sample #9