DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10794>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10794

User interaction for authentication





------- Additional Comments From [EMAIL PROTECTED]  2003-10-01 08:12 -------
snippet of David Hay's posting to the HTTP client mailing list:

I would suspect that
any authorization callback handler would need to pass along the host, port,
realm, authorization scheme and possibly the status code (so we'd know if
this was a proxy authorization or not).

Just to give an implementation idea, what I currently have is an iterface
called AuthorizationPrompter that has a single method:

    public Credentials getCredentials( String realm, String host );

I can then register implementations of this with my custom HttpState
subclass.  Then, my HttpState subclass I have the following code:

    public synchronized Credentials getCredentials( String realm, String
host )
    {
        Credentials credentials = super.getCredentials( realm, host );
        if ( credentials == null ) {
            credentials = promptForCredentials( realm, host );
            if ( credentials != null ) {
                setCredentials( realm, host, credentials );
            }
        }
        return credentials;
    }

there's a similar method for getProxyCredentials.  Of course, the "if
(credentials == null)" should probably live in the calling method, but
that's the idea.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to