This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 224576
Collapse All | Expand All

(-)a/hudson/src/org/netbeans/modules/hudson/ui/APITokenConnectionAuthenticator.java (-1 / +2 lines)
Lines 90-95 Link Here
90
        }
90
        }
91
91
92
        @Messages({"# {0} - server location", "# {1} - user name", "APITokenConnectionAuthenticator.password_description=API token for {1} on {0}"})
92
        @Messages({"# {0} - server location", "# {1} - user name", "APITokenConnectionAuthenticator.password_description=API token for {1} on {0}"})
93
        @org.netbeans.api.annotations.common.SuppressWarnings("DM_DEFAULT_ENCODING")
93
        @Override public URLConnection forbidden(URLConnection conn, URL home) {
94
        @Override public URLConnection forbidden(URLConnection conn, URL home) {
94
            String version = conn.getHeaderField("X-Jenkins");
95
            String version = conn.getHeaderField("X-Jenkins");
95
            if (version == null) {
96
            if (version == null) {
Lines 127-133 Link Here
127
            String token = new String(panel.tokField.getPassword());
128
            String token = new String(panel.tokField.getPassword());
128
            panel.tokField.setText("");
129
            panel.tokField.setText("");
129
            Keyring.save(key, token.toCharArray(), APITokenConnectionAuthenticator_password_description(home, username));
130
            Keyring.save(key, token.toCharArray(), APITokenConnectionAuthenticator_password_description(home, username));
130
            BASIC_AUTH.put(home.toString(), new Base64().encodeToString((username + ':' + token).getBytes()).trim());
131
            BASIC_AUTH.put(home.toString(), new Base64(0).encodeToString((username + ':' + token).getBytes()).trim());
131
            try {
132
            try {
132
                return conn.getURL().openConnection();
133
                return conn.getURL().openConnection();
133
            } catch (IOException x) {
134
            } catch (IOException x) {

Return to bug 224576