~ubuntu-branches/ubuntu/natty/icedtea-web/natty-security

« back to all changes in this revision

Viewing changes to netx/net/sourceforge/jnlp/security/JNLPAuthenticator.java

  • Committer: Bazaar Package Importer
  • Author(s): Matthias Klose
  • Date: 2011-02-24 12:57:25 UTC
  • mto: (18.1.1 experimental) (19.1.1 natty-security)
  • mto: This revision was merged to the branch mainline in revision 15.
  • Revision ID: james.westby@ubuntu.com-20110224125725-8zq5v35r6o27w8ku
Tags: upstream-1.1~20110320
ImportĀ upstreamĀ versionĀ 1.1~20110320

Show diffs side-by-side

added added

removed removed

Lines of Context:
42
42
 
43
43
public class JNLPAuthenticator extends Authenticator {
44
44
 
 
45
    @Override
45
46
    public PasswordAuthentication getPasswordAuthentication() {
46
47
 
47
48
        // No security check is required here, because the only way to set
50
51
 
51
52
        String type = this.getRequestorType() == RequestorType.PROXY ? "proxy" : "web";
52
53
 
53
 
        // request auth info from user
54
 
        PasswordAuthenticationDialog pwDialog = new PasswordAuthenticationDialog();
55
 
        PasswordAuthentication auth = pwDialog.askUser(this.getRequestingHost(), this.getRequestingPort(), this.getRequestingPrompt(), type);
 
54
        String host = getRequestingHost();
 
55
        int port = getRequestingPort();
 
56
        String prompt = getRequestingPrompt();
56
57
 
57
 
        // send it along
58
 
        return auth;
 
58
        Object[] response = SecurityDialogs.showAuthenicationPrompt(host, port, prompt, type);
 
59
        if (response == null) {
 
60
            return null;
 
61
        } else {
 
62
            return new PasswordAuthentication((String) response[0], (char[]) response[1]);
 
63
        }
59
64
    }
60
65
 
61
66
}