1 /*******************************************************************************
2 * Copyright (c) 2003, 2016 IBM Corporation and others.
4 * This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License 2.0
6 * which accompanies this distribution, and is available at
7 * https://www.eclipse.org/legal/epl-2.0/
9 * SPDX-License-Identifier: EPL-2.0
12 * IBM Corporation - initial API and implementation
13 *******************************************************************************/
14 package org.eclipse.swt.browser;
16 import org.eclipse.swt.internal.*;
19 * This listener interface may be implemented in order to receive
20 * an {@link AuthenticationEvent} notification when the {@link Browser}
21 * encounters a page that requires authentication.
23 * @see Browser#addAuthenticationListener(AuthenticationListener)
24 * @see Browser#removeAuthenticationListener(AuthenticationListener)
29 public interface AuthenticationListener extends SWTEventListener {
32 * This method is called when a page is navigated to that requires
35 * Setting both the event's <code>user</code> and <code>password</code>
36 * fields causes these values to be used as credentials for authentication.
37 * Leaving one or both of these fields as <code>null</code> indicates
38 * that credentials are not known, so an authentication prompter should
39 * be shown to the user. Otherwise, setting the event's <code>doit</code>
40 * field to <code>false</code> cancels the authentication challenge, and
41 * the page will not be loaded.
44 * <p>The following fields in the <code>AuthenticationEvent</code> apply:</p>
46 * <li>(in) widget the <code>Browser</code> that is attempting to show the
47 * page that requires authentication
48 * <li>(in) location the location issuing the authentication challenge
49 * <li>(in/out) doit can be set to <code>false</code> to cancel the
50 * authentication challenge
51 * <li>(out) user the user name to authenticate with
52 * <li>(out) password the password to authenticate with
55 * @param event the <code>AuthenticationEvent</code> that can be used to
56 * either supply authentication credentials, defer credential input to
57 * an authentication prompter, or cancel an authentication challenge.
59 public void authenticate(AuthenticationEvent event);