authenticating HTTP connections without user interaction

Best, Jan-Pascal van j.p.vanbest at tbm.tudelft.nl
Tue Jul 16 12:55:48 BST 2002


Waldo wrote:

> You can call addAuthInfo via DCOP in kpasswd see
> SlaveBase::cacheAuthentication( const AuthInfo& info ) for an example.
> window-id should either be equal to topLevelWidget()->winId() in which
case
> the password is cached for the existance of the main-window.
> Or the window-id can be 0 in which case you want to set the
> AuthInfo::keepPassword to true.
Thanks, that works (except that topLevelWidget() is actually
QApplication::topLevelWidgets() ;)

    DCOPClient *dcopClient = new DCOPClient();
    dcopClient->attach();

    long windowId = QApplication::topLevelWidgets()->first()->winId();

    QByteArray params;
    QDataStream stream(params, IO_WriteOnly);
    stream << info << windowId;

    dcopClient->send( "kded", "kpasswdserver",
"addAuthInfo(KIO::AuthInfo, long int)", params );
-- 
Jan-Pascal van Best
Delft University of Technology
http://www.tbm.tudelft.nl/webstaf/janb/index.htm 




More information about the kfm-devel mailing list