void TwitterEditAccountWidget::authorizeUser()
{
    kDebug();
    qoauth = new QOAuth::Interface(new KIO::AccessManager(this), this);//TODO KDE 4.5 Change to use new class.
    // set the consumer key and secret
    qoauth->setConsumerKey( twitterConsumerKey );
    qoauth->setConsumerSecret( twitterConsumerSecret );
    // set a timeout for requests (in msecs)
    qoauth->setRequestTimeout( 20000 );
    qoauth->setIgnoreSslErrors(true);

    QOAuth::ParamMap otherArgs;

    // send a request for an unauthorized token
    QOAuth::ParamMap reply =
        qoauth->requestToken( "https://twitter.com/oauth/request_token",
                              QOAuth::GET, QOAuth::HMAC_SHA1 );

    // if no error occurred, read the received token and token secret
    if ( qoauth->error() == QOAuth::NoError ) {
        token = reply.value( QOAuth::tokenParameterName() );
        tokenSecret = reply.value( QOAuth::tokenSecretParameterName() );
        kDebug()<<"token: "<<token;
        QUrl url("https://twitter.com/oauth/authorize");
        url.addQueryItem("oauth_token", token);
        url.addQueryItem( "oauth_callback", "oob" );
        Choqok::openUrl(url);
        getPinCode();
    } else {
        kDebug()<<"ERROR: " <<qoauth->error()<<' '<<Choqok::qoauthErrorText(qoauth->error());
        KMessageBox::detailedError(this, i18n("Authorization Error"),
                                   Choqok::qoauthErrorText(qoauth->error()));
    }
}
bool PlurkApiOAuth::authorizeUser()
{
    kDebug();
    // set the consumer key and secret
    d->qoauth->setConsumerKey( plurkConsumerKey );
    d->qoauth->setConsumerSecret( plurkConsumerSecret );
    // set a timeout for requests (in msecs)
    d->qoauth->setRequestTimeout( 20000 );
    d->qoauth->setIgnoreSslErrors(true);

    QOAuth::ParamMap otherArgs;

    // send a request for an unauthorized token
    QOAuth::ParamMap reply =
        d->qoauth->requestToken( plurkOAuthRequestTokenURL, QOAuth::GET, QOAuth::HMAC_SHA1 );

    // if no error occurred, read the received token and token secret
    if ( d->qoauth->error() == QOAuth::NoError ) {
        d->oauthToken = reply.value( QOAuth::tokenParameterName() );
        d->oauthTokenSecret = reply.value( QOAuth::tokenSecretParameterName() );
        kDebug() << "token: " << d->oauthToken;
        QUrl url(plurkOAuthAuthorizeURL);
        url.addQueryItem("oauth_token", d->oauthToken);
        url.addQueryItem( "oauth_callback", "oob" );
        KToolInvocation::invokeBrowser(url.toString());
        return getPinCode();
    } else {
        kDebug() << "ERROR: " << d->qoauth->error() << ' ' << oauthErrorText(d->qoauth->error());
        // TODO use a parent widget for this message box
        KMessageBox::detailedError(0, "Authorization Error",
                                   oauthErrorText(d->qoauth->error()));
    }

    return false;
}